Is there a word-wrap or any other attribute that stops text from wrapping? I have a height, and overflow:hidden
, and the text still breaks.
Needs to work in all browsers, before CSS3.
Is there a word-wrap or any other attribute that stops text from wrapping? I have a height, and overflow:hidden
, and the text still breaks.
Needs to work in all browsers, before CSS3.
You can use
CSS white-space Property
to achieve this.Sometimes using
instead of spaces will work. Clearly it has drawbacks, though.Note: this only works on block elements. If you need to do this to table cells (for example) you need to put a div inside the table cell as table cells have display table-cell not block.As of CSS3, this is supported for table cells as well.
Using ellipsis will add the ... at the last.