【发布时间】:2013-01-16 11:08:58
【问题描述】:
我试图使用省略号将链接限制为宽度。
html 是这样的:
<a class="blueLink2 destination-url-space" style="top:0;" href="http://google.com/uyv245">http://google.com/iuh345345345gthrthrthrth</a>
CSS 是
.blueLink2 {
color: #0051A1;
display: inline;
font-size: 14px;
margin-left: 5px;
overflow: hidden;
position: relative;
text-overflow: ellipsis;
top: 0;
}
.destination-url-space {
display: inline-block;
max-width: 200px;
overflow-x: hidden;
}
但它只适用于 Chrome。不能在 Firefox 中工作。 演示:http://jsfiddle.net/xE6HG/
【问题讨论】: