Interactive CSS navigation menu |
| Written by AnaS | |
|
CSS is a strong tool for controlling the way the content is displayed. Using CSS properties you will have a good looking interactive menu, but also search engine friendly.
For the beginning you should have a picture like this:
<span id="menu"> <ul class="navigation"> <li><a href=# class="menu">Home</a></li> <li><a href=# class="menu">Products</a></li> <li><a href=# class="menu">Services</a></li> <li><a href=# class="menu">Contact</a></li> </ul> </span> </body> </html>
ul.navigation{ list-style:none; /* this line will remove any kind of bullet from the menu */ width: 160px; /* sets the menu width */ margin:0; padding:0; }
#menu a { display: block; /* this is a very important property here and it controls the way the menu elements are displayed - like block-level elements */ padding: 5px 3px 5px 10px; /* sets the padding properties */ font-weight:bold; /* sets the font weight */ background-color: #222222; /* sets the color of the background */ border-top: 1px solid #efefef; /* this code sets the line between the menu items */ }
#menu a:link { color: #efefef; /* sets the font color */ text-decoration: none; }
#menu a:visited { color: #efefef; text-decoration: none; }
#menu a:hover { background:#222222 url(menu-arrow.gif) no-repeat left center; /* when the cursor is over, in the left side of the menu item background it will be display the arrow.gif picture */ text-indent:15px; /* this line of code move the text 15 px to the right */ }
#menu a:active { color: #efefef; text-decoration: none; }
For more webdesign resources view webdesign tutorial
Do you need more help? Ask now!
|
|
| Last Updated ( Tuesday, 10 April 2007 ) |