![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programming Guru
![]() ![]() |
Hey,
check it: menu.css <style type="text/css">
<!--
ul.root, ul.root ul {
display: block;
margin: 0;
padding: 0;
background-color: #FFFFFF;
}
ul.root li {
margin: 0;
}
ul.root li {
display: inline;
list-style: none;
position: relative;
margin: 0;
padding: 0;
}
ul.root li ul {
display: block;
position: absolute;
left: 0;
top: 1em;
visibility: hidden;
width: 9em;
z-index: 1000;
}
ul.root li ul li {
margin: 0 0 0 -1.5em;
padding: 0;
display: block;
width: 100%;
margin-left: 0;
}
ul.root li ul li a {
display: block;
margin: 0;
padding: 0 0 0 5%;
width: 100%;
width: 95%;
}
ul.root li.submenu:hover {
padding-bottom: 30em;
}
ul.root li.submenu:hover ul {
left: 0;
visibility: visible;
}
-->
</style>then in your page just do this: <html>
<head>
<link rel="stylesheet" type="text/css" href="menu.css">
</head>
<body>
<ul class="root">
<li><a href="#">Link 1</a></li>
<li class="submenu"><a href="#">Link with drop-down</a>
<ul>
<li><a href="#">Sub-item 1</a></li>
<li><a href="#">Sub-item 2</a></li>
</ul>
</li>
</ul>
</body>
</html>Currently this makes a menu that is horizontal, but with a few easy changes you can make it virtical.
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() |
also this won't work in IE because it doesn't support CSS2
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Looking good. I'm gonna have to try this out.
|
|
|
|
|
|
#4 |
|
Newbie
Join Date: Nov 2004
Posts: 12
Rep Power: 0
![]() |
There's a tut here http://www.meyerweb.com/eric/css/edge/menus/demo.html and some other goodies at http://www.meyerweb.com/eric/css/edge/
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|