SlideShare a Scribd company logo
Mr. Downs
                                                                                Web Design II
                                                                                     B Block
                           Tutorial – Custom Buttons CSS/HTML




 This Tutorial covers the CSS and HTML of making your own custom button, as seen in
 the picture above. (Left)
 ________________________________________________________________________
 CSS: Below is the CSS code. Notice that the button used in this code is only the
 background, while the actual button on top of that layer will be placed into the HTML
 code. In other words, the image “button4.png” is the image that appears when you
 rollover the button with your mouse. The code below also can format the size of your
 button as it appears on your page, which is done in the first section of the code. The CSS
 code below can go anywhere within the internal CSS section of your code. Make sure
 not to interrupt any other existing code and end this, if it is not there already, with the tag
 of <style>. Take time to perfect the code below for it will decide all the details of the
 button, from text to size.

.cssnav
{
position: relative;
font-family: arial, helvetica, sans-serif;
background: url(button4.png) no-repeat;
white-space: nowrap;
display: block;
width: 150px;
height: 50px;
margin: 0;
padding: 0;
}
.cssnav a
{
display: block;
color: #000000;
font-size: 11px;
width: 150px;
height: 50px;
display: block;
float: left;
color: white;
text-decoration: none;
}

.cssnav img
{
width: 150px;
height: 50px;
border: 0
}

* html a:hover
{
visibility:visible
}

.cssnav a:hover img
{
visibility:hidden
}

.cssnav span
{
position: absolute;
left: 35px;
top: 15px;
margin: 0px;
padding: 0px;
cursor: pointer;
}



 HTML: This is the HTML section of the code. This can go into any div class of your
 webpage, but is most commonly used in the left column. The code below is just the
 simplified version, the bolded text applies to just one button, but this code can be
 repeated multiple times for different buttons. The two tags on each side of the bolded
 code are just opening and closing tags. The “title” section is purely the name of the link
 you are going to, but is not official. The “span” section is the actual text which will
 appear on the button. The “alt” section is just the same name as title. Be careful when
 putting the text together below, and don’t forget the opening and closing tags. Also, if
 not already there, don’t forget to put in the ending div tag “</div>.”

<!--MAIN NAVIGATION START-->
<div class="cssnav"><a href="index.html" title="Search Engine
 Optimization"><img src="button3.png" alt="Search Engine Optimization"
 /><span>Home</span></a></div>

<!--MAIN NAVIGATION END-->




 This is the end of this Tutorial.

More Related Content

PPTX
Tips for Making Property Presentation
PPT
Ar tutorial
PPT
IML 140 Design - Basics
PDF
Sheryl tapon canva tutorial
PPTX
Creating electronic output from frame maker 12-Adobe webinar oct 9 2014
PDF
HOW TO USE AD ESPRESSO
DOCX
Jm-forma responsive joomla template
PDF
HOW TO USE TRELLO
Tips for Making Property Presentation
Ar tutorial
IML 140 Design - Basics
Sheryl tapon canva tutorial
Creating electronic output from frame maker 12-Adobe webinar oct 9 2014
HOW TO USE AD ESPRESSO
Jm-forma responsive joomla template
HOW TO USE TRELLO

Viewers also liked (20)

PDF
Tutorial flash
PDF
Project based learning rubric
PDF
Copy of analysis of marketing plan of nike and michael jordan
PDF
Technology intelligences
PDF
Collaboration approach daniel downs
PDF
History of pbl
PDF
Sitepoint.com a basic-html5_template
PPT
Lebron
PDF
February 2012 newsletter
PDF
Ad age advertising century top 100 advertising campaigns
PDF
Rollover button tutorial
PDF
Ad age advertising century top 100 advertising campaigns
PDF
Outline for action research prospectus
PDF
Making a basicappinflash (1)
PDF
Why use pbl
PPT
Developing a mobile application curriculum which empowers authentic
PDF
Variables chapter 2 php book
PPT
IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...
PPT
Cebit 2008 - PeerfactSim.KOM - A Simulator for Large Scale Peer-to-Peer Systems
PPT
Kalman Graffi - Efficiency and Information Management in Peer-to-Peer Systems
Tutorial flash
Project based learning rubric
Copy of analysis of marketing plan of nike and michael jordan
Technology intelligences
Collaboration approach daniel downs
History of pbl
Sitepoint.com a basic-html5_template
Lebron
February 2012 newsletter
Ad age advertising century top 100 advertising campaigns
Rollover button tutorial
Ad age advertising century top 100 advertising campaigns
Outline for action research prospectus
Making a basicappinflash (1)
Why use pbl
Developing a mobile application curriculum which empowers authentic
Variables chapter 2 php book
IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...
Cebit 2008 - PeerfactSim.KOM - A Simulator for Large Scale Peer-to-Peer Systems
Kalman Graffi - Efficiency and Information Management in Peer-to-Peer Systems
Ad

Similar to Rollover button tutorial (20)

KEY
PDF
Divs and Links Styles
KEY
RWD in the Wild
PPT
PPT
Web Design 101
PDF
Intro to CSS
KEY
Topsy Turvy Design
DOCX
Sacramento web design
PPT
Intro to web_design_notes jalen
KEY
CSS3 Takes on the World
PPT
Developing a Web Page
PPTX
Repaired Evaluation
PDF
Web Design In Easy Steps 5th Edn Sampler
DOCX
Lesson 4 Adding Navigator and PagesAdding Links Transcript- .docx
DOC
Class 2 handout css exercises (2)
PPTX
Customizing WordPress Themes
PDF
PDF
Divs and Links Styles
RWD in the Wild
Web Design 101
Intro to CSS
Topsy Turvy Design
Sacramento web design
Intro to web_design_notes jalen
CSS3 Takes on the World
Developing a Web Page
Repaired Evaluation
Web Design In Easy Steps 5th Edn Sampler
Lesson 4 Adding Navigator and PagesAdding Links Transcript- .docx
Class 2 handout css exercises (2)
Customizing WordPress Themes
Ad

More from Daniel Downs (20)

PDF
Module11: Creating A External Style Sheet and Creating A Gallery
PDF
Seo continued page 2
PDF
Module 10search engine optimization
PDF
Ipad quick-reference-2
PDF
Index of jquery template 2 Minuteman Summer Web Dev.
PDF
Jquery template 1 3 pages
PDF
Module6 htmlcss helpfulcodeandwebsites
PDF
Module 4 Minuteman Lexington Web Design Daniel Downs
PDF
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington Ma
PDF
Module 2 lexington minuteman web development basic layout template
PDF
Module 1 Web design & Development Lexington Minuteman
PDF
App research project
PDF
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...
PDF
Blogger custom domain on go daddy blogger widgets
PDF
You have decided to go off on your own as a freelance webdesigner
PDF
Daniel Downs Technology Portfolio Final May 2013 final (1)
PDF
Web design 1& 2 lesson outline
PDF
You are part of an international news team reporting from a foreign country
PDF
Marketing plan powerpoint
PDF
Final screen castfinalweb12
Module11: Creating A External Style Sheet and Creating A Gallery
Seo continued page 2
Module 10search engine optimization
Ipad quick-reference-2
Index of jquery template 2 Minuteman Summer Web Dev.
Jquery template 1 3 pages
Module6 htmlcss helpfulcodeandwebsites
Module 4 Minuteman Lexington Web Design Daniel Downs
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington Ma
Module 2 lexington minuteman web development basic layout template
Module 1 Web design & Development Lexington Minuteman
App research project
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...
Blogger custom domain on go daddy blogger widgets
You have decided to go off on your own as a freelance webdesigner
Daniel Downs Technology Portfolio Final May 2013 final (1)
Web design 1& 2 lesson outline
You are part of an international news team reporting from a foreign country
Marketing plan powerpoint
Final screen castfinalweb12

Rollover button tutorial

  • 1. Mr. Downs Web Design II B Block Tutorial – Custom Buttons CSS/HTML This Tutorial covers the CSS and HTML of making your own custom button, as seen in the picture above. (Left) ________________________________________________________________________ CSS: Below is the CSS code. Notice that the button used in this code is only the background, while the actual button on top of that layer will be placed into the HTML code. In other words, the image “button4.png” is the image that appears when you rollover the button with your mouse. The code below also can format the size of your button as it appears on your page, which is done in the first section of the code. The CSS code below can go anywhere within the internal CSS section of your code. Make sure not to interrupt any other existing code and end this, if it is not there already, with the tag of <style>. Take time to perfect the code below for it will decide all the details of the button, from text to size. .cssnav { position: relative; font-family: arial, helvetica, sans-serif; background: url(button4.png) no-repeat; white-space: nowrap; display: block; width: 150px; height: 50px; margin: 0; padding: 0; }
  • 2. .cssnav a { display: block; color: #000000; font-size: 11px; width: 150px; height: 50px; display: block; float: left; color: white; text-decoration: none; } .cssnav img { width: 150px; height: 50px; border: 0 } * html a:hover { visibility:visible } .cssnav a:hover img { visibility:hidden } .cssnav span { position: absolute; left: 35px; top: 15px; margin: 0px; padding: 0px; cursor: pointer; } HTML: This is the HTML section of the code. This can go into any div class of your webpage, but is most commonly used in the left column. The code below is just the simplified version, the bolded text applies to just one button, but this code can be repeated multiple times for different buttons. The two tags on each side of the bolded code are just opening and closing tags. The “title” section is purely the name of the link you are going to, but is not official. The “span” section is the actual text which will appear on the button. The “alt” section is just the same name as title. Be careful when putting the text together below, and don’t forget the opening and closing tags. Also, if not already there, don’t forget to put in the ending div tag “</div>.” <!--MAIN NAVIGATION START-->
  • 3. <div class="cssnav"><a href="index.html" title="Search Engine Optimization"><img src="button3.png" alt="Search Engine Optimization" /><span>Home</span></a></div> <!--MAIN NAVIGATION END--> This is the end of this Tutorial.