Home >Web Front-end >HTML Tutorial >Please help me take a look at this_html/css_WEB-ITnose

Please help me take a look at this_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:11:24886browse





安誉欢迎您

* {
padding:0;
margin:0
}
#top {
width:100%;
height:20px;
border-bottom:solid 1px #D5D5D5;
background:url(img/top.jpg)
}
body {
background-image: url(img/body_bgck.jpg);
background-repeat: repeat-x;
}
/*网站主体*/
#main {
width:910px;
height:1024px;
border:solid 1px #71B8FF;
margin:auto;
}
/* 导航栏*/
#nav {
width:auto;
height:40px;
border: solid 1px #E9FEFC;
margin-top:80px;
}
#nav_left {
width:63px;
height:40px;
margin-left:0px;
margin-top:0px;
float:left;
background:url(img/nav_left.png) left no-repeat;
}
#nav_rigth {
width:63px;
height:40px;
margin-right:0px;
margin-top:0px;
float: right;
background:url(img/nav.png) no-repeat;
}
#nav_content {
width:785px;
height:40px;
margin:auto;
background:url(img/nav_content.png) repeat-x;
clear: none;
}
.nav_ul {
display:block;
width:100%;
height:40px;
margin-top:0;
}
.nav_li {
list-style:none;
float:left;
display: block;
padding:5px;
margin-top: 3px;
margin-right: 20px;
margin-bottom: 3px;
margin-left: 20px;
}







  
    
      

      

       

      首页
      等等
      试试
      会员中心
      交流
      
    
  




现在是这个文字在导航栏的下面。怎么样进去导航栏里面? 谢谢了


回复讨论(解决方案)

nav你定的40px的高度,当然都挤没了,你给#nav加个overflow:hidden,毛都剩不下了。

还有ul里放些独立于li的div干嘛。。 放也就算了,nav_left,nav_right浮动了,nav_contents应该clear掉浮动,否则都nav_contents盖在nav_left和right上了。

写得不规范。。

给你个建议  像布局这种东西,尤其是像你这div这么多的情况下  
你最好给每个div加上不同的背景颜色或者加上边框颜色;
用来区分你现在要操作的位置,你光这么看看死你;

我敢保证你加上颜色你就知道你错哪了!!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn