当前位置:Gxlcms > html代码 > 网站横向导航增加显示不出来_html/css_WEB-ITnose

网站横向导航增加显示不出来_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:30人阅读

最近帮朋友修改网站,因为是初学div+css,所以不知道添加导航标题以后为什么会不显示出来,好像被遮盖了一样。
在文件css.css中应该怎么样修改导航菜单属性和值。
希望会的朋友能给我一些提示,代码我随后就贴上~~


回复讨论(解决方案)

也许导航的外层 设置了 宽度限制。并且加了 overflow:hidden;

1。楼上说的 内容超过外层宽 超宽了 给隐藏了
2。新加入的跟原来的不再同一行 超高了 给隐藏了
3。新加入的内容被别的元素挡住了

用火狐firebug 看一看就知道了

最近帮朋友修改网站,因为是初学div+css,所以不知道添加导航标题以后为什么会不显示出来,好像被遮盖了一样。
在文件css.css中应该怎么样修改导航菜单属性和值。
希望会的朋友能给我一些提示,代码我随后就贴上~~
css 的代码如下 :
body{
font-size:13px;
margin:0px;
padding:0px;
text-align:center;
color:#000;
background:#000;
font-family:Tahoma, Verdana; }

a:link,a:visited{color:#000;text-decoration:none;}
a:hover{color:red;text-decoration: none;}

div,img,ul,ol,dl,dt,dd {
border:0;
list-style:none;
overflow:hidden;
margin:0;
padding:0;
}

h1,h2,h3,h4,h5,h6 {
font-size:12px;
margin:0;
padding:0;
}
/*---清除浮动---*/
.clear {
clear:both;
height:0;
overflow:hidden;
}

.container{
width: 1050px;
margin:0 auto;
background-color: #CCC;
}

.header{
width: 1050px;
height: 197px;
background-color: #00F;
}
.hdtop{
width: 1050px;
height: 163px;
background: url(eshow/home_top.gif);
}
.topdh{
width: 1050px;
height: 40px;
background-color: #00F;
background-image: url(eshow/home_dh.gif);
}
.topdh li{
float:left;
margin-left:8px;
margin-top:10px;
list-style:none;
display:table-cell;
padding:0px 5px 0px 5px;}
.topdh a:link,.topdh a:visited{color:#000;text-decoration:none; font-weight:bold; font-size:13px;}
.topdh a:hover{color:#006600;text-decoration: none; font-weight:bold; font-size:13px;}
.list{
width:auto;
height:auto;
margin: 5px auto;
background-color: #666;
}
.ad000{width:790px; height:74px; margin-bottom:5px;}
.ls_z{
width: 250px;
height:806px;
float: left;
display: inline;
background: #F2F2F2;
}
.ls_y{
width: auto;
height: auto;
margin-left: 5px;
float: left;
display: inline;
}
.ls_dz{
width: 238px;
height:450px;
border:1px solid #DFDFDF;
background-color: #666;
margin-top: 5px;
margin-right: auto;
margin-bottom: 5px;
margin-left: auto;
}
.ls_dz h1,.ls_dz h2,.ls_dz h3{text-align:left; height:25px; line-height:1.8em; padding-left:10px; border-bottom:1px #dfdfdf solid;}
.ls_dz h3{ background:url(eshow/links.gif); padding-left:35px;}
.ls_ad{
width: auto;
height: 30px;
background-color: #999;
}
.ls_fc{
border:1px solid #DFDFDF;
width: auto;
height: 360px;
margin-top: 5px;
margin-right: auto;
margin-left: auto;
}
td{font-size:12px;}
.lswz{
width: 300px;
height: 350px;
margin-top: 2px;
float: left;
}
.lswz h4,.lswz h1{ height:25px;
width:265px;
text-align:left;
line-height:1.8em;
padding-left:35px;
background:url(eshow/dd_bg.gif);
}
.lswz ul{ text-align:left; padding:4px; border-top:1px solid #DFDFDF; margin-top:2px}
.lswz a{border-bottom:1px dashed #DFDFDF;}
.books{
width: 175px;
height: 350px;
margin-top: 2px;
}
.books h2{
height:25px;
width:535px;
text-align:left;
padding-left:35px;
line-height:1.8em;
background:url(eshow/books.gif);
}
.books ul{ text-align:left;}

.footer{
width: 1050px;
height: 100px;
background-color: #CCC;
margin-top: 0;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
}
/**********************************************/
.main{
clear:both;
padding:8px;
text-align:center;
}
/*第一种形式*/
#tabs0,#tabs1 {
height: 260px;
width: 238px;
border: 1px solid #DFDFDF;
background:#fff;
margin-top:5px;
}
.menu0,.menu1{
width: 238px;
border-bottom: 1px solid #DFDFDF;
}
.menu0 li,.menu1 li{
display:block;
float: left;
padding: 4px 0;
width:80px;
text-align: center;
cursor:pointer;
background: #FFFFff;
border-right: 1px solid #DFDFDF;
}
.menu0 li.hover,.menu1 li.hover{
background: url(eshow/xuanbg.jpg);
color:#fff;
}
#main0 a,#main1 a{
border-bottom:1px #d4d4d4 dashed;
}
#main0 ul,#main1 ul{
display: none;
text-align:left;
line-height:1.4em;
}
#main0 ul.block,#main1 ul.block{
display: block;
}
/******************************************/
.biaoti{width:100%; height:auto;margin-top:5px; float:left}
.biaoti h2{height:25px; background:#F0F0F0; padding-top:5px; font-size:13px;}
.container .footer ul li div {
font-family: Georgia, Times New Roman, Times, serif;
}

HTML 代码呢

HTML 代码呢

HTML 代码呢

引用楼主 的回复:
最近帮朋友修改网站,因为是初学div+css,所以不知道添加导航标题以后为什么会不显示出来,好像被遮盖了一样。
在文件css.css中应该怎么样修改导航菜单属性和值。
希望会的朋友能给我一些提示,代码我随后就贴上~~


css 的代码如下 :
body{
font-size:13px;
margin:0px;
padding:0px;
text……
html 代码:

XXX数字图书馆


这里 ul 的宽度 是要根据你有几个li 来增加的不是一成不变,例如一个li的宽度是 60px。那你每增加一个li 这里的 680就要对应的增加宽度。 注意这里的我只是举例是 60px 具体的宽度要根据字符宽度+18px

谢谢,问题成功解决。但是我能再请教么 菜单标题修改完成后。为什么我一点击链接,会变为原本的菜单标题样式。诚心请教,我也找过资料看,但找不到切入点…

人气教程排行