http://jsfiddle.net/Just1End/BTLXS/
如果您查看上面的链接,您会发现下拉菜单很奇怪。每个下拉菜单的第一项总是用图像突出显示....当您将鼠标悬停在项目上时(在下拉菜单中),它们会得到图像。你能帮我弄清楚我怎样才能做到这一点,以便下拉菜单保持红色并在悬停时变为浅红色。我也不希望图像出现在第一个项目上。有点奇怪。这也是我第一次尝试下拉菜单,我真的很需要帮助。谢谢
代码:
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'> </script>
<style>
#cssmenu ul {
list-style-type: none;
position: relative;
display: block;
font-size: 12px;
background: url(http://minecraft-serverlist.org/e-scape/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(http://minecraft-serverlist.org/e-scape/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;
}
</style>
</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>