我的text-overflow: ellipsis
在用换行符隔开文本时无法在Internet Explorer中工作。文本溢出:省略号在Internet Explorer中的换行符后不起作用
在Firefox和Chrome中,两行文本都会被省略号截断。在Internet Explorer中,第一行用省略号截断,第二行仅在右侧截断。
这里是我的代码:
.text-wrapper {
border: solid 1px #C2C2C2;
padding:10px;
}
.text-wrapper p{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
<div class="text-wrapper" style="width:250px;">
<p>
This line overflows and gets an ellipsis in any browser.
<br/>
This line overflows and gets an ellipsis in any browser except IE.
</p>
</div>
它使用的是这种方式在任何浏览器中,对于这种行为,预是必需的。至少,仍然没有在IE中工作。这是一个错误?不知道W3C关于期望的行为的说法... https://www.w3.org/TR/2002/WD-css3-text-20021024/#text-overflow-props –