谁能告诉我为什么菜单中第一个元素的设计会中断?
这是代码。
<html>
<head>
<title>Dynamic Drop Down menu in php</title>
<link href="css/menustyle.css" rel="stylesheet">
</head>
<body>
<ul id="menu">
<li><img src="logo.png"></li>
<li><a href="home.php">Home</li>
<li><a href="index.php">Forms</li>
<li><a href="#">Databases</li>
<li><a href="login.php">Account</li>
<li><a href="#">Support</li>
</ul>
</body>
</html>
<style type="text/css">
ul {
font-family: Arial, Verdana;
font-size: 14px;
margin: 0;
padding: 0;
list-style: none;
}
ul li {
display: block;
position: relative;
float: left;
}
li ul {
display: none;
}
ul li a {
display: block;
text-decoration: none;
color: #ffffff;
border-top: 1px solid #ffffff;
padding: 5px 15px 5px 15px;
background: #1e7c9a;
margin-left: 1px;
white-space: nowrap;
}
ul li a:hover {
background: #3b3b3b;
}
li:hover ul {
display: block;
position: absolute;
}
li:hover li {
float: none;
font-size: 11px;
}
li:hover a { background: #3b3b3b; }
li:hover li a:hover {
background: #1e7c9a;
}
</style>