在 Chrome 中,单击结果 Pane 并点击 Tab 以关注此处的第一个链接:
http://jsfiddle.net/2q6c7c36/2/
请注意 .box 的内容是如何“跳出”其边界的?它似乎是由我正在使用的 clearfix 类引起的。这是 Chrome 中的错误还是我做错了什么?我在为图标字体使用伪元素时也注意到了这一点。
谢谢。
.clearfix:after{
content: ".";
visibility: hidden;
display: block;
height: 0;
clear: both;
}
最佳答案
演示 - http://jsfiddle.net/victor_007/2q6c7c36/3/
将 content:"."
设置为 content:""
.box {
border: 2px solid black;
border-radius: 10px;
position: absolute;
float: left;
width: 318px;
overflow: hidden;
}
.clearfix:after {
content: "";
visibility: hidden;
display: block;
height: 0;
clear: both;
}
a {
display: inline-block;
background-color: #555;
color: white;
text-decoration: none;
font-family: helvetica;
padding: 3px;
}
<div class="box clearfix">
<a href="#" class="button">Button</a>
<a href="#" class="button">Button</a>
<a href="#" class="button">Button</a>
</div>
关于html - 链接之间的制表符会导致 Chrome 中的伪元素出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26415250/