2009-01-19, 09:26 PM
I'm trying to make a drop down navigation menu that holds links that will also sprout out other links. Here's the HTML:
The CSS:
But instead of what I'm wanting, I'm getting what you see: http://www.totalityworks.co.cc/band.html
The two lists are merging into one and losing some links. Can anyone help me?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title>Band Name | Home</title>
<meta name="keywords" content="Band, Band Name" />
<meta name="description" content="Tish is Band Name" />
<script type="text/javascript">
<!--//--><![CDATA[//><!--
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>
</script>
<link href="band.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1>Band Name</h1>
<h2>Witty Comment Here!</h2>
</div>
<div id="nav">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="/band">The Band</a>
<ul>
<li><a href="/band/about.html">About</a></li>
<li><a href="/band/bios">Bios</a>
<ul>
<li><a href="/band/bios/max.html">Max Cosme</a></li>
<li><a href="/band/bios/garret.html">Garret Rhoades</a></li>
<li><a href="/band/bios/deacon.html">"Deacon" Jones</a></li>
<li><a href="/band/bios/fain.html">Brandon Fain</a></li>
<li><a href="/band/bios/miguel.html">Miguel Cosme</a></li>
<li><a href="/band/bios/shane.html">Shane Bailey</a></li>
</ul>
</li>
</ul>
<li><a href="networks.html">Social Networkings</a>
<ul>
<li><a href="http://www.myspace.com">Myspace</a></li>
<li><a href="http://www.facebook.com">Facebook</a></li>
</ul>
</li>
<li><a href="/discography">Discography</a>
<ul>
<li><a href="/discography/album1">1st Album</a>
<ul>
<li><a href="/discography/album1/song1.html">Song 1</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="/forums">Fan Forums</a></li>
<li><a href="/blog">Blog/News</a>
<ul>
<li><a href="#">Recent Changes</a></li>
<li><a href="#">Appearances</a></li>
<li><a href="#">Site Changes</a></li>
<li><a href="#">New Songs</a></li>
</ul>
</li>
<li><a href="fanmail.html">Fan Mail</a></li>
</ul>
</div>
<div id="content"
<div id="left">
<h2>Recent Changes</h2>
<p>[Read More]</p>
</h2>
<h2>Comments</h2>
<p>[Read More]</p>
</div>
<div id="center">
<p id=locate">You are Here:<br />
<a href="index.html">Home</a>
</p>
<h2>Welcome!</h2>
<p>To the Band Name website.</p>
<h2>Quick Intro</h2>
<p>Here's a quick introduction to our website and our band.</p>
<p>{Donations}<br />
<p>{Advertisements}</p>
</div>
<div id="footer">
<p>Copyright © 2009 <a href="http://www.totalityworks.co.cc">Totality Works</a>
Design by <a href="http://www.elegant-totality.info">Elegant Totality</a></p>
</div>
The CSS:
#nav {
height: 28px;
background: #222;
}
#nav ul {
float: left;
padding: 0;
margin: 0;
list-style: none;
}
#nav li {
position: relative;
float: left;
}
#nav a {
display: block;
float: left;
padding: 0 15px;
line-height: 28px;
color: #EEE;
text-decoration: none;
}
#nav a:hover {
color: #AAA;
}
#nav li ul {
position: absolute;
top: 28px;
left: -999em;
width: 150px;
}
#nav li li {
width: 150px; /* width required here for Opera bug */
border-top: solid 1px #555;
}
#nav li li a {
width: 120px;
padding: 5px 15px;
line-height: 1.2;
color: #EEE;
}
#nav li li a:hover {
background: #AAA;
color: #222;
}
#nav li:hover ul,
#nav li.sfhover ul {
left: 0;
z-index: 100; /* ensures drop down menus appear over other content on the Z-axis */
background: #222; /* background (color at least) required here for IE7 bug */
}
But instead of what I'm wanting, I'm getting what you see: http://www.totalityworks.co.cc/band.html
The two lists are merging into one and losing some links. Can anyone help me?