Drop Down Menu with CSS & xHTML only (no Javascript)
It really is easy. Basically you have your ul with li's within and then ul and li's within that:
HTML Code:
<ul id="menu">
<li>A lovely Tab
<ul><li>sub tab #1</li>
<li>sub tab #2</li>
</ul>
</li>
<li>A lovely Tab#2
<ul><li>sub tab #21</li>
<li>sub tab #22</li>
</ul>
</li>
Code:
ul { /*this applies to all ul tags*/
margin: 0; padding: 0; /*stops them moving around too much*/}
ul#menu li { list-style: none; float: left; padding: 5px; }
ul#menu li ul { display: none; /*hides the submenu clever bit now:*/
position: absolute; top: auto; left: auto; /*makes it appear below the item*/ }
/*now we need to show it on hover*/
ul#menu li:hover ul { display: block; }
/*now we style the sub menus li's*/
ul#menu li ul li { display: block; float: none; /*makes them appear on top of each other*/ }
http://kerplunc.com/projects/_css/drop_down_menu.php
[WARNING: do not copy that page directly, it has no <body> or <head> or <html> set up properly, it is just for testing]
Enjoy...
Search-
Rreth meje-
- Mizake
- A man with an obsession to make Blogger Template Layout have ability that not simply as an usual blog.
Lemon Twist Blogger Template is an extremely beautiful blogger template created by JackBook.Com based on Lemon Twist Wordpress themes by farfromfearless.com. You can edit this words into your own.