Step 1: HTML Code
As I same on top of, this tutorial comes with CSS solely, you don’t have to be compelled to embrace any JavaScript to your tag  <ul id="navigation">     <li class=""> <a href="#">Parent Item 1</a> </li>     <li class=""> <a href="#">Parent Item 2</a>       <ul>         <li class=""> <a href="#">Child Item 1</a> </li>         <li class=""> <a href="#">Child Item 2</a> </li>         <li class=""> <a href="#">Child Item 3</a> </li>         <li class=""> <a href="#">Child Item 4</a> </li>         <li class=""> <a href="#">Child Item 5</a> </li>       </ul>     </li>     <li class=""> <a href="#">Parent Item 3</a>       <ul>         <li class=""> <a href="#">Child Item 1</a> </li>         <li class=""> <a href="#">Child Item 2</a> </li>       </ul>     </li>     <li class=""> <a href="#">Parent Item 4</a> </li>   </ul>
Step 2: CSS Code
Ya! consider CSS code below. i will be able to organize CSS code generator into every applied half. CSS code for the hold Navigation and Parent things is:/* Navigation */ #navigation { Â Â Â Â list-style: none; Â Â Â Â font-family: "Century Gothic", Verdana, Arial, Sans-Serif; Â Â Â Â margin: 0; Â Â Â Â padding: 0; Â Â Â Â font-size: 1.2em; } /* CSS for each Parent Item */ #navigation li { Â Â Â Â clear: both; Â Â Â Â height: 2em; } #navigation li a { Â Â Â Â float: left; Â Â Â Â display: block; Â Â Â Â padding: 4px; Â Â Â Â text-decoration: none; Â Â Â Â color: #666; Â Â Â Â text-transform: uppercase; Â Â Â Â margin-bottom: 5px; Â Â Â Â margin-right: 10px; } /* Change background color and font color of parent items when mouse hover */ #navigation li:hover a, #navigation li a:hover { Â Â Â Â background: #999; Â Â Â Â color: #fff; }
Finally, we've to reset and re vogue the link within every kid item as a result of the link
already formatted higher than, you'll be able to realize it within css code block of Parent Item.
/* Reset and re style link of each child item */ #navigation li:hover ul li a, #navigation ul li a { Â Â Â Â display: inline; Â Â Â Â padding: 0 6px 0 0; Â Â Â Â float: none; Â Â Â Â text-transform: lowercase; Â Â Â Â color: #999; Â Â Â Â background: none; } #navigation li:hover ul li a:hover, #navigation ul li a:hover { Â Â Â Â background: none; Â Â Â Â color: #000; }
That’s all we want to create the Navigation works.
[smart ads]
In this CSS tutorials, I solely show you ways to create the horizontal drop. you'll simple to try to to a similar with sink vertical menu result by downloading my code.

No comments:
Post a Comment