为什么子菜单在Firefox中正确显示但不是chrome

时间:2012-03-20 18:41:59

标签: html css wordpress

为什么chrome会在子菜单上显示额外的10个像素?对于父菜单,他们是否以不同的方式呈现位置?这是css:

#nav ul li ul{
display: none;
width: 250px;
opacity: .7;
z-index: 999;

}

#nav ul li:hover ul{
display: block;
background-color: #444444;
padding: 0;
margin: 0;
position: absolute;
top: 20px;
border-top: 19px solid black;
}

在行动中看到它:

http://guardianweb.edulence.com/model3/

2 个答案:

答案 0 :(得分:1)

基于what I can see,看起来Chrome和IE9正在正确渲染页面,但Firefox 11却没有。 this你指的是额外的10个像素吗?

就个人而言,我放弃top: 20px让Firefox 11渲染子菜单与Chrome和IE9相同。

答案 1 :(得分:0)

你的li:hover ul顶部有一个19px的边框,这个边框没有测量到框的高度,基本上是在你的subnav上方另外19px的间隙。同样在你的styles.css第80行附近,你会看到#nav ul得到padding:10px 0;它也被应用于subnav。在第一个li

之上给它10px填充