一模一样的代码,我的效果也太诡异了……
始终想不明白哪里出错了……
为什么nav_right会出现在上面???而不是跟他们水平
float属性里面不是已经设置了么……
新手求教啊!!!!
css文件中代码:
.nav_left {
width: 10px;
background: url(../images/nav_left.jpg) no-repeat;
}
.nav_mid{
width:980px;
background:url(../images/nav_bg.jpg) repeat-x;
}
.nav_right{
width:10px;
background:url(../images/nav_right.jpg) no-repeat;
}
.nav_left,.nav_mid,.nav_right{
float:left;
height:40px;
}
index.html中的:
<div class="nav">
<div class="nav_left"></div>
<div class="nav_mid">
<div class="nav_mid_left"></div>
<ul>
<li><a href="#">首页</a></li>
<li><a href="list.html">关于慕课</a></li>
<li><a href="list.html">新闻动态</a></li>
<li><a href="list.html">课程中心</a></li>
<li><a href="list.html">在线课程</a></li>
<li><a href="list.html">人才招聘</a></li>
</ul>
<div class="nav_mid_right">
<form action="" method="post">
<input type="text"/>
</form>
</div>
</div><!-- nav-mid结束 -->
<div class="nav_right"></div>
</div><!-- nav结束 -->
</div><!--wrap结束 -->