Hi all
I’ve been trying all day to get this drop down menu working. The code works fine when the menu is text only but I’m using background images for the buttons normal and hover states. The main problem is that the image used of the nav button is being shown in place of the drop down menu buttons, also when I roll off the button on to the drop down menu I want the button stay on the hover state but it goes back to the normal state.
Here is a link to a stripped down version and an image of what I’m trying to achieve.
Any help with this would be greatly appreciated
http://www.ttmt.org.uk/dropdown/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style type="text/css" media="screen">
#headerwrap{
background:#4bb9c6;
height:164px;
}
#headercontent{
height:100%;
position:relative;
width:900px;
margin:0 auto;
}
#headercontent #mainNav{
position:absolute;
bottom:0;
}
#headercontent #mainNav li{
float:left;
}
#headercontent #mainNav li a{
display:block;
text-indent:-1000em;
position:relative;
}
#headercontent #mainNav li.home a{
height:41px;
width:62px;
background:url(home.gif) 0 0 no-repeat;
overflow:hidden;
}
#headercontent #mainNav li.courses a{
height:41px;
width:83px;
background:url(courses.gif) 0 0 no-repeat;
overflow:hidden;
}
#headercontent #mainNav li.home a:hover{
background:url(home.gif) 0 -41px no-repeat;
}
#headercontent #mainNav li.courses a:hover{
background:url(courses.gif) 0 -41px no-repeat;
}
#headercontent #mainNav li ul{
position:absolute;
left:-1000em;
background:#3a8f99;
width:5em;
}
#headercontent #mainNav li ul a{
color:#fff;
text-indent:0;
background: #3a8f99;
}
#headercontent #mainNav li:hover ul{
left:auto;
}
#explain{
position:absolute;
bottom:0;
}
</style>
</head>
<body>
<div id="wrap">
<div id="headerwrap">
<div id="headercontent">
<ul id="mainNav">
<li class="btn home"><a href="#">Home</a></li>
<li class="btn courses"><a href="#">Courses</a>
<ul>
<li><a href="http://www.google.com">One</a></li>
<li><a href="http://www.bbc.com">Two</a></li>
<li><a href="#">Three</a></li>
<li><a href="#">Four</a></li>
<li><a href="#">Five</a></li>
</ul>
</li>
</ul>
</div><!-- #headercontent -->
</div><!-- #headerwrap -->
<div id="explain">
<h2>I wanted it to work something like this</h2>
<img src="test.gif" />
</div><!-- #explain -->
</body>
</html>