以下是我的代码:
CSS代码:
#logo a{
float:left;
margin: 0;
padding: 0;
}
#toplink{
float: left;
margin: 50px 0 0 415px; /* 这里 IE6 设置成415PX 正好,但firefox 要设置成 615px */
/* margin: 50px 0 0 615px !important; */
padding: 0;
}
#toplink ul{
margin: 0;
padding: 0;
list-style: none;
}
#toplink li{
float: left;
list-style: none;
border: none;
border-left: 1px solid #fff;
margin: 0;
padding: 0 12px;
}
#toplink li.up{
border: none;
}
#toplink a{
font-size: 110%;
text-decoration: none;
color: #fff;
margin: 0;
padding: 0;
}
HTML代码:
<div id="logo">
<a href="./"><img src="img/logo.gif" alt="LOGO"/></a>
<ul id="toplink">
<li class="up"><a href="#">首页</a></li>
<li><a href="#">登录</a></li>
<li><a href="#">注册</a></li>
</ul>
</div>
各位高手我的CSS错误在哪里? 有什么办法么?
------解决方案--------------------
- HTML code
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta name="Author" content="Doyoe(飘零雾雨), edzmaster@gmail.com" /> <title>test</title> <style type="text/css"> #logo { width:600px; background:#aaa; overflow:hidden; } #logo a { float:left; margin:0; padding:0; } #toplink { float:right; margin:50px 0 0 0; padding:0; list-style:none; } #toplink li { float:left; border-left:1px solid #fff; margin:0; padding:0 12px; } #toplink li.up { border:none; } #toplink a { font:12px/120% "宋体"; text-decoration:none; color:#fff; } </style> </head> <body> <div id="logo"> <a href="./"><img src="img/logo.gif" alt="LOGO" /></a> <ul id="toplink"> <li class="up"><a href="#">首页</a></li> <li><a href="#">登录</a></li> <li><a href="#">注册</a></li> </ul> </div> </body> </html>