I'm having trouble with my navigation bar and I need help styling it. I want the navigation bar to have a dropdown menu when the user hovers over the top level of the navigation bar. The issue I am facing is that the second level of the navigation bar is not displaying correctly.
Here is my HTML code:
<div id="menubar">
<ul id="menu">
<li class="selected"><a href="">Home</a></li>
<li><a href="">Volunteers</a>
<ul>
<li><a href="">Add</a></li>
<li><a href="">View</a></li>
<li><a href="">Update</a></li>
</ul>
</li>
<li><a href="">Packaging Session</a>
<ul>
<li><a href="">Add</a></li>
<li><a href="">View</a></li>
<li><a href="">Update</a></li>
</ul>
</li>
</ul>
</div>
And here is my CSS code:
#menubar
{
width: 900px;
height: 72px;
padding: 0;
background: #1293EE;
}
ul#menu, ul#menu li
{
float: left;
margin: 0;
padding: 0;
}
ul#menu li
{
list-style: none;
}
ul#menu li a
{
letter-spacing: 0.1em;
font: normal 100% arial, sans-serif;
display: block;
float: left;
height: 37px;
padding: 29px 26px 6px 26px;
text-align: center;
color: #FFF;
text-transform: uppercase;
text-decoration: none;
background: transparent;
}
ul#menu li a:hover, ul#menu li.selected a, ul#menu li.selected a:hover
{
color: #FFF;
background: #0D66A5;
}
ul#menu li ul li a
{
display: none;
height: auto;
margin: 0;
padding: 0;
position:absolute;
}
If there are any suggestions on how to style the second level of the navigation bar properly in Google Chrome or Internet Explorer, please let me know.