TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

CSS "text-overflow: ellipsis;" finally landed in Gecko

88 点作者 thomasbachem将近 14 年前

8 条评论

treyp将近 14 年前
"text-overflow: ellipsis" is a great start, but it's really too bad it only applies to individual lines of text (via "white-space: nowrap").<p>it would be very useful if we had a property to truncate text when it reaches the end of a container with a fixed height. so if the container is 3.5 lines tall, 3 lines should be shown with an ellipsis at the last character. bonus points if we can specify a separator, so that the ellipsis will only be applied after the last whole word (space), line (line break), or just character.
评论 #2692018 未加载
评论 #2692887 未加载
igorw将近 14 年前
Next up: "text-align: centaur" (<a href="http://textaligncentaur.com" rel="nofollow">http://textaligncentaur.com</a>).
thomasbachem将近 14 年前
Yep, that means that every major browser (including IE6!) supports it now. As soon as FF6 has spread, we can begin to make real use of it :).
评论 #2691822 未加载
评论 #2691826 未加载
评论 #2691781 未加载
zachrose将近 14 年前
There is a way to get this working before FF5, it just involves a weird hack with an XML file.<p><a href="http://mattsnider.com/css/css-string-truncation-with-ellipsis/" rel="nofollow">http://mattsnider.com/css/css-string-truncation-with-ellipsi...</a><p>Yay for not needing this down the road.
评论 #2692617 未加载
评论 #2692437 未加载
评论 #2693985 未加载
gurraman将近 14 年前
Awesome! I've always felt dirty fixing text-overflow (more often than not a cosmetic fix) on the backend, albeit it's not often feasible to create web sites where content and presentation are truly separated.
dave1010uk将近 14 年前
jQuery Mobile makes extensive use of this (though I've turned it off on a mobile app I'm making).<p>CanIUse shows that Firefox is the last browser to support ellipsis [1] and comparing Firefox 7 to Chrome 14 [2] shows a few other things that some web developers would like.<p>Firefox also has quite a long way to go on HTML5 forms [3].<p>[1] <a href="http://www.caniuse.com/#search=overflow" rel="nofollow">http://www.caniuse.com/#search=overflow</a> [2] <a href="http://www.caniuse.com/#compare=y&#38;b1=firefox+7&#38;b2=chrome+14" rel="nofollow">http://www.caniuse.com/#compare=y&#38;b1=firefox+7&#38;b2=ch...</a> [3] <a href="http://wufoo.com/html5/" rel="nofollow">http://wufoo.com/html5/</a>
nddrylliog将近 14 年前
Unfortunately it will have to wait for FF7 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=312156&#38" rel="nofollow">https://bugzilla.mozilla.org/show_bug.cgi?id=312156&#38</a>;
评论 #2692139 未加载
wladimir将近 14 年前
I've been missing this feature in HTML for so long when making tables/overviews. Great to hear it's finally implemented.
评论 #2692000 未加载
评论 #2695185 未加载