I am attempting to create a CSS dropdown menu for the first time. I have encountered some issues along the way. The dropdown menu appears correctly with a red background color, but the first item displays a different background image instead of the red background like the rest. Can someone please review this code on jsfiddle or elsewhere and provide some guidance on how to fix it?
<html>
<head>
<link rel='stylesheet' type='text/css' href='css/styles.css' />
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'> </script>
</head>
<body>
<div id='cssmenu'>
<ul>
<li><a href='index.html'><span>Home</span></a></li>
<li><a href='team'><span>Team</span></a>
<ul>
<li><a href='team'>Team</a></li>
<li><a href='team'>Team2</a></li>
<li><a href='team'>Team3</a></li>
</ul>
</li>
<li><a href='sponsors'><span>Sponsors</span></a></li>
<li><a href='first'><span>First</span></a></li>
<li><a href='contact-us'><span>Contact Us</span></a></li>
<li class='last'><a href='handouts'><span>Handouts</span></a></li>
</ul>
</div>
</body>
</html>
AND THE CSS:
#cssmenu ul {
list-style-type: none;
position: relative;
display: block;
font-size: 12px;
background: url(../images/bg.png) repeat-x top left;
font-family: Verdana, Helvetica, Arial, sans-serif;
border: 1px solid #000;
margin: 0;
padding: 0;
width: auto;
}
#cssmenu li {
display: inline-block;
margin: 0;
padding: 0;
}
#cssmenu li ul {
position: absolute;
display: none;
}
#cssmenu li ul li {
display: block;
}
#cssmenu li:hover ul {
display: block;
}
#cssmenu li a {
display: block;
color: #A79787;
text-decoration: none;
padding: 9px 15px;
font-weight: normal;
}
#cssmenu li a:hover,
#cssmenu .active {
color: #fff;
background: url(../images/bg.png) repeat-x top left;
text-decoration: none;
}
#cssmenu .active a {
color: #fff;
font-weight: 700;
}
#cssmenu ul {
background-color: #B11718;
}
#cssmenu li a:hover,
#cssmenu li.active {
background-color: #DE3330;
}
Any help in resolving this issue would be greatly appreciated. Thank you.