Greetings all.
zincoxide I really like the drop down menu you created! I tried it on my website and ran into a couple of problems., Would you be willing to take a look at the code to see what I am doing wrong?
Here is the css
HTML Code:
}
body {
font-family: arial, helvetica, serif;
}
ul { /* all lists */
padding: 0;
margin: 0;
list-style: none;
}
li { /* all list items */
float: left;
position: relative;
width: 10em;
}
li ul { /* second-level lists */
display: none;
position: absolute;
top: 1em;
left: 0;
}
li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the containing li, rather than bottom left */
top: auto;
left: auto;
}
li:hover ul, li.over ul { /* lists nested under hovered list items */
display: block;
}
#content {
clear: left;
}
/* Drop down menu */
#nav {
list-style: none;
width: 96%;
margin: 0 auto;
background: url('www.truthforbusiness.com/images/menu-bg.gif') repeat-x top left;
}
#nav li {
float: left;
position: relative;
width: 16.6%;
}
#nav li:hover {
background: url('www.truthforbusiness.com/images/menu-bg-hover.gif') repeat-x top left;
}
#nav li a {
color: #ffffff;
font-weight: bold;
text-decoration: none;
text-align: center;
height: 30px;
line-height: 30px;
width: 100%;
display: block;
}
#nav li ul {
border-left:1px solid #ffffff; border-right:1px solid #ffffff; border-bottom:1px solid #ffffff; display: none;
position: absolute;
top: 100%;
left: 0;
width: 180px;
background-color: #000000;
opacity: .5;
-moz-opacity: .5;
filter: alpha(opacity=50);
border-top: 0px none;
}
#nav li > ul {
top: auto;
left: auto;
}
#nav li:hover ul {
display: block;
}
#nav ul li {
width: 100%;
}
#nav ul li a {
text-align: left;
width: 90%;
padding: 0 5%;
line-height: 20px;
height: 20px;
}
#nav ul li:hover a {
background-color: #AAAAAA;
color: #000000;
And here is my html.
HTML Code:
<script type="text/javascript"><!--//--><![CDATA[//><!--
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("mainlevel-toolbar");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
//--><!]]></script>
</head>
<body>
<ul id="nav">
<li>Sunfishes
<ul>
<li><a href="">Blackbanded sunfish</a></li>
<li><a href="">Shadow bass</a></li>
<li><a href="">Ozark bass</a></li>
<li><a href="">White crappie</a></li>
</ul>
</li>
<li>Grunts
<ul>
<li><a href="">Smallmouth grunt</a></li>
<li><a href="">Burrito</a></li>
<li><a href="">Pigfish</a></li>
</ul>
</li>
<li>Remoras
<ul>
<li><a href="">Whalesucker</a></li>
<li><a href="">Marlinsucker</a></li>
<li><a href="">Ceylonese remora</a></li>
<li><a href="">Spearfish remora</a></li>
<li><a href="">Slender suckerfish</a></li>
</ul>
</li>
</ul>
Thanks a lot, getting this menu worked out will really help me.
Ian
|