早教吧 育儿知识 作业答案 考试题库 百科 知识分享

求div+css高手帮忙解决下,IE8显示不正常,IE6正常!源代码付上/*Nav*/.nav{position:relative;margin:00px0px;background:url(images/navbg.png)no-repeat0-36px;}.navinner{background:url(images/navbg.png)no-repeat100%-72px;}.navl

题目详情
求div+css高手帮忙解决下,IE8显示不正常,IE6正常!源代码付上
/* Nav
*/
.nav {
position:relative;
margin:0 0px 0px;
background:url(images/nav_bg.png) no-repeat 0 -36px;
}
.navinner {
background:url(images/nav_bg.png) no-repeat 100% -72px;
}
.navlist {
height:36px;
line-height:36px;
overflow:hidden;
margin:0 10px;
background:url(images/nav_bg.png) repeat-x 0 0;
}
.nav li {
float:left;
display:inline;
margin:0 0 0 -2px;
padding:0 4px 0 6px;
background:url(images/nav_bg.png) no-repeat 0 -108px;
}
.nav a {
display:block;
width:70px;
text-align:center;
font-size:12px;
}
.nav a:link,.nav a:visited {
color:#fff;
}
.nav a.current,.nav a:hover,.nav a:active {
color:#fff;
font-weight:bold;
background:url(images/nav_bg.png) no-repeat 50% -144px;
}
.subnav {
position:absolute;
top:41px;
left:0;
float:left;
height:27px;
line-height:27px;
white-space:nowrap;
background:url(images/nav_bg.png) no-repeat 0 -180px;
}
* html .subnav {
margin:0 10px 0 -10px; /* IE 6 and below */
}
.subnav p {
padding:0 10px;
background:url(images/nav_bg.png) no-repeat 100% -234px;
}
.subnav p span {
display:block;
background:url(images/nav_bg.png) repeat-x 0 -207px;
}
.subnav p.pointer {
position:absolute;
top:-4px;
left:0;
height:5px;
width:11px;
padding:0;
margin-left:20px;
text-indent:-999em;
background:url(images/nav_bg.png) repeat-x 0 -261px;
}
.subnav a {
display:inline;
padding:0;
font-size:100%;
}
[class~="subnav"] a {
padding:0 3px;
}
.subnav,.subnav a:link,.subnav a:visited {
color:#235e99;
}
.subnav a:hover,.subnav a:active {
color:#235e99;
}
.subnav a:hover,.subnav a:active {
font-weight:normal;
background:none;
border-bottom:2px solid;
}
/* subnav position and pointer position */
#subnav1 { left:70px; }
#subnav2 { left:150px; }
#subnav3 { left:230px; }
#subnav4 { left:460px; }
#subnav5 { left:550px; }
#subnav6 { left:620px; }
#subnav7 { left:630px; }
#subnav1 .pointer,
#subnav2 .pointer,
#subnav3 .pointer,
#subnav4 .pointer { left:30px; }
#subnav5 .pointer { left:auto; right:290px; }
#subnav6 .pointer { left:auto; right:180px; }
#subnav7 .pointer { left:auto; right:70px; }
#subnav1,#subnav2,#subnav3,#subnav4 {
min-width:110px;
}
#subnav5 { min-width:340px; }
#subnav6 { min-width:240px; }
#subnav7 { min-width:130px; }
▼优质解答
答案和解析
第一行就不对,有了相对定位,也没有具体地址.一个导航条不用相对定位比较好.
只有li而没有ul,它的其实用来定位还可以.
left:auto;这一句是我一直没有见过的内容.先学习一下.