开发者

CSS: Visual Hint That Text Overflows

I'm looking for a way to mark when text overflows it's container. Th开发者_高级运维e code goes like in this example. Basically, it's a <span> with a set size. I want some kind of marker to show me when the text overflows.

I tried text-overflow:ellipsis;, which sounded perfect, except that it only works if the parent is the one whose size is restricted (right?).

Does anyone have any pure-CSS (JS and editing the HTML is out of the question here) ideas for how to alert me to when the text is being clipped?

Thanks!


You have to add the white-space: nowrap; style to the container along with the text-overflow:ellipsis;.
See here

Edit Here's some more info on it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜