作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我试图使用省略号将链接的宽度限制在一定范围内。
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/
最佳答案
你需要在那里添加white-space: nowrap;
关于html - 省略号在 firefox 中运行不佳,但在 chrome 中运行良好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14641202/
我是一名优秀的程序员,十分优秀!