css代码如下:
.nav{
width: 1000px;
height: 40px;
background: url("../images/nav_bg.jpg") repeat-x;
margin: 0 auto;
}
.nav .nav_left{
float: left;
}
.nav_left li{
list-style-type: none;
float: left;
width: 100px;
line-height: 40px;
text-align: center;
}
.nav_left a{
text-decoration: none;
color: white;
font-size: 16px;
font-family: 微软雅黑;
}
.nav .nav_right{
float: right;
}
html代码如下:
效果:
li的flot设置成了left
效果不应该是靠左么 为什么会出现在灰色条的中间呢?
求解
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
右键,审查下就好...
猜测是ul的默认样式带padding的问题