我想在 overflow
发生时显示 ...
,
但遗憾的是在 css 中只有 overflow:hidden
接近但不完全是我想要的。
是否可以实现?
最佳答案
text-overflow: ellipsis;
参见 http://www.quirksmode.org/css/textoverflow.html和 https://developer.mozilla.org/en/CSS/text-overflow .但是,不支持 Firefox。
编辑:有一个 jQuery plugin为了这。安装完成后,调用
$(thatElement).ellipsis();
激活样式。参见 http://jsbin.com/acuti3 .有一个bunch of other jQuery plugins除此之外。
关于javascript - 是否可以实现溢出:ellipsis with javascript or css?的效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2995656/