第一个div(overflowhidden)中的标题与第二个div中的标题(nooverflow)不在同一个垂直位置。为什么“溢出”属性给出不同的结果?
的的jsfiddle链接如下:
的HTML是
<div class="line">
<span class="attr">title :</span>
<span id="overflowhidden" class="content"> this is long content</span>
</div>
<div class="line">
<span class="attr">title :</span>
<span id = "nooverflow" class="content"> this is long content</span>
</div>
的CSS是:
.line {
height: 30px;
width: 200px;
outline: 1px dashed;
}
.attr {
position: relative;
width: 30px;
}
.content {
position: relative;
display: inline-block;
left: 40px;
width: 100px;
height: 20px;
line-height: 20px;
text-overflow: ellipsis;
white-space: nowrap;
border-radius: 15px;
border: 1px solid greenyellow;
}
#overflowhidden {
overflow: hidden;
}
请在*的问题你的代码*。 – George 2014-09-30 14:35:03
据我所知,他们看起来都一样吗? http://jsfiddle.net/84fermg6/10/ – 2014-09-30 14:47:13
@ Dejan.S对不起,我不熟悉jsfiddle。链接是更新 http://jsfiddle.net/Lrnz4mff/ – user1140560 2014-10-01 01:46:33