Hello. I'm trying to make a drop-down menu based on a hierarchical unordered list system.
This is the code I tried to modify (so that it would work with my code):
- Code: Select all
#navigation ul {
position: absolute;
top: 101px;
}
#navigation {
width: 100%;
background: #eee;
float: left;
}
#navigation ul {
list-style: none;
margin: 0;
padding: 0;
float: left;
}
#navigation a, #navigation h2 {
font: bold 11px/16px arial, helvetica, sans-serif;
display: block;
margin: 0;
padding: 2px 3px;
}
#navigation h2 {
color: #fff;
background: #000;
text-transform: uppercase;
}
#navigation a {
height: 25px;
color: #000;
background: #9F9F9F;
text-decoration: none;
}
#navigation a:hover {
color: #a00;
background: #fff;
}
#navigation li {
position: relative;
margin: 0;
}
#navigation ul ul {
position: absolute;
z-index: 500;
top: 23px;
width: 200px;
}
#navigation ul ul li {
width: 100%;
border: 1px solid #000000;
margin: 0;
padding: 0;
}
#navigation ul ul ul {
top: 0;
left: 100%;
}
div#navigation ul ul, div#navigation ul li:hover ul ul, div#navigation ul ul li:hover ul ul {
display: none;
}
div#navigation ul li:hover ul, div#navigation ul ul li:hover ul, div#navigation ul ul ul li:hover ul {
display: block;
}
<!--[if IE]>
<style type="text/css" media="screen">
body {
behavior: url(csshover.htc);
font-size: 100%;
}
#navigation ul li {
float: left;
list-style: none;
}
#navigation ul li a {
height: 1%;
}
#navigation a, #navigation h2 {
font: bold 0.7em/1.4em arial, helvetica, sans-serif;
}
</style>
<![endif]-->
This is all the
CSS I have for #navigation:
- Code: Select all
#navigation {
height: 15px;
background: url(images/nav.png) no-repeat;
}
#navigation ul li {
float: left;
list-style: none;
margin-right: 3px;
}
#navigation ul li a {
display: block;
width: 100px;
padding-top: 15px;
overflow: hidden !important;
}
#navigation ul .navigation a {
background: url(images/navigation.png) no-repeat;
}
#navigation ul .bof1 a {
background: url(images/bof1.png) no-repeat;
}
#navigation ul .bof2 a {
background: url(images/bof2.png) no-repeat;
}
#navigation ul .bof3 a {
background: url(images/bof3.png) no-repeat;
}
#navigation ul .bof4 a {
background: url(images/bof4.png) no-repeat;
}
#navigation ul .bof5 a {
background: url(images/bof5.png) no-repeat;
}
#navigation ul li ul li {
display: none;
width: 200px;
clear: both;
}
#navigation ul.bof1:hover ul .bof1menu {
display: block;
width: 200px;
}
This is my unordered list:
- Code: Select all
<ul>
<li class="navigation"><a href="#"></a></li>
<li class="bof1"><a href="#"></a></li>
<li class="bof2"><a href="#"></a></li>
<li class="bof3"><a href="#"></a></li>
<li class="bof4"><a href="#"></a></li>
<li class="bof5"><a href="#"></a></li>
</ul>
Anyone know how I can get a drop-down menu to work?