我有一个带有悬停效果的简单水平菜单
在Chrome/Firefox中它的显示正常,但在IE11中,元素之间会有1像素的边框。
当您悬停在左侧链接上时,您可以看到它:http://jsfiddle.net/cMeE5/ 以下是屏幕截图:IE11 Screenshot http://users.telenet.be/mhd/ie11.png 这个垂直边框还好,但是相同类型的边框总是显示在菜单项的底部(但在JSFiddle中无法重现)。
我还尝试添加了完整的CSS Reset但并没有改变任何东西。
以下是JSFiddle上的代码:
CSS样式表:
当您悬停在左侧链接上时,您可以看到它:http://jsfiddle.net/cMeE5/ 以下是屏幕截图:IE11 Screenshot http://users.telenet.be/mhd/ie11.png 这个垂直边框还好,但是相同类型的边框总是显示在菜单项的底部(但在JSFiddle中无法重现)。
我还尝试添加了完整的CSS Reset但并没有改变任何东西。
以下是JSFiddle上的代码:
<div id="navcontainer">
<div id="midnav">
<ul>
<li><a href="#">Link A</a></li>
<li class="activesub"><a href="#">Link B</a></li>
</ul>
</div>
</div>
<div id="maincontainer">
<div id="main">
<h1>Test</h1>
</div>
</div>
CSS样式表:
* { margin: 0; padding: 0;}
html { min-height: 100%; height: 100%; margin-bottom: 1px; overflow-y: scroll;}
body {
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 0.875em;
background-color: #ebebeb;
color: black;
height: 100%;
}
a, a:active, a:hover, a:visited, a:link {
text-decoration: none;
font-weight: none;
background-color: none;
color: inherit;
}
/********************/
/*** SUBNAVIGATIE ***/
/********************/
#navcontainer {
width: 100%;
background-color: #464646;
}
#midnav {
width: 1000px;
margin: 0 auto;
color: white;
padding-top: 0.3em;
}
#midnav ul {
list-style-type: none;
display: table;
}
#midnav li {
display: table-cell;
-moz-border-radius-topleft: 7px;
-webkit-border-top-left-radius: 7px;
border-top-left-radius: 7px;
-moz-border-radius-topright: 7px;
-webkit-border-top-right-radius: 7px;
border-top-right-radius: 7px;
-webkit-transition: all 0,1s ease;
-moz-transition: all 0,1s ease;
-o-transition: all 0,1s ease;
-ms-transition: all 0,1s ease;
transition: all 0,1s ease;
}
#midnav a {
display: block;
padding: 0.3em 1em 0.5em 1em;
}
.activesub, #midnav li:hover {
color: #464646;
background-color: #ebebeb;
}
/********************/
/*** MAIN CONTENT ***/
/********************/
#maincontainer {
width: 100%;
background-color: #ebebeb;
}
#main {
width: 1000px;
margin: 0 auto;
color: #464646;
}
#maincontainer p {
margin-bottom: 1em;
margin-top: 1em;
}
#navcontainer{ outline:0 }
或者在出现问题的地方添加。 - Jackdisplay:table
,但我没有看到任何border-spacing
。 - Mr Lister