Reputation: 1449
I am trying to force the paragraphs in a small div to all be one line, no wrap, and when they overflow over the div to be truncated with ellipsis.
I got the no wrap working with white-space:nowrap;
, but the text is still overflowing over the div even though I have set text-overflow to be ellipsis.
What am I doing wrong?
It shouldn't be support, because, surprisingly, both of those css3 properties are widely supported.
Here is a js fiddle with the problem: http://jsfiddle.net/4C7CW/
Upvotes: 4
Views: 3767
Reputation: 9348
text-overflow
The text-overflow declaration allows you to deal with clipped text: that is, text that does not fit into its box.
text-overflow comes into play only when:
So...
#card
{
width:200px;
background:red;
color:#000000;
font-size:16px;
}
#card p
{
-o-text-overflow:ellipsis;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
}
Upvotes: 6