views:

94

answers:

1

Hi, When using CSS overflow: hidden , I've often found that the last line of text gets partially cut-off. Is there a way to prevent this so that any partial lines do not show-up. Almost like a veritcal word-wrap.

Thanks!

A: 

Rob is correct. I was making a div that had a max-height of 11em and the last line of overflow text was only half there. white-space: nowrap just eliminates that last line all together.

I tried

white-space: nowrap;

and Gaby is also correct that this causes problems too.

The best I came up with was to fiddle with the line-height and div height until the fewest lines were cut-off

Get the Jaws of Life
this only works because your last line was produced by a long line wrapping. If there was an <br /> in it, it would still partially show .. You need to make sure that the `height` of the div can be exactly divided by its `line-height` ..
Gaby
Makes sense. I did make the height of the div something like 11em. Would that make any difference?
Get the Jaws of Life