_nav_medium始终占据一行,试了评论里的办法,还是解决不了

来源:3-4 企业网站制作之导航部分制作(一)

慕斯卡2154061

2016-09-05 20:19

*{
   margin:0;
   padding: 0;
   font-size: 12px;
}
body{
   background-color: #f5f5f5;
}

.top{
  width: 100%;
  height: 27px;
  background:url(../images/top_bg.jpg) repeat-x;
}

.top_content{
   width: 1000px;
   margin: 0 auto;
}

.top_content li{
   list-style-image: url(../images/li_bg.gif);
   float: right;
   width: 70px;
   line-height: 27px;
}

.top_content a:link,.top_content a:visited
{
   color: #8E8E8E;
   text-decoration: none;
}

.top_content a:hover,.top_content a:active{
   color: #900;
   text-decoration: none;
}
.warp{
   width: 1000px;
   margin: 0 auto;
}
.logo{
   height: 80px;
   background-color: #ffffff;
   /*overflow:hidden;*/

}
.logo_left{
   width: 200px;
   float:left;
   height: 80px;

}
.logo_right{
  width: 300px;
  float: right;
  height:28px;
  margin-top: 30px;
  color: #8E8E8E;
}

.logo_right img{
  vertical-align: middle;
   margin-right: 10px;
}

.tel{
   font-family: "微软雅黑";
   font-size: 16px;
   color: #C00;
}

.nav{
   height: 40px;
   float:left;
}

.nav_left{
   width: 40px;
   background: url(../images/nav_left.jpg) no-repeat;
   float: left;
   height: 40px;

}

.nav_medium{
   width: 980px;
   background: url(../images/nav_bg.jpg) repeat-x;
   height: 40px;
   float: left;

}
.nav_right{
   width: 10px;
   height: 40px;
   background: url(../images/nav_right.jpg) no-repeat;
   float: left;
}

写回答 关注

2回答

  • 忠胜大哥
    2016-09-05 21:39:42
    已采纳

    在网页上调试看是什么挤开了,可能是浮动或者块级元素等等,用浮动试试

    慕斯卡215...

    非常感谢!

    2016-10-18 19:43:08

    共 1 条回复 >

  • 祈祈祈祈祷
    2016-09-05 21:24:41

    块级元素就是占据一行的啊,你试下转化成内联元素看看

企业网站综合布局实战

本课程重点介绍HTML/CSS实现常见企业网站布局的方法

157044 学习 · 1984 问题

查看课程

相似问题