Given some text that occupies about 10 rows, how can I resize its container to only show the first 3 rows and hide the others? Apparently this works, but I think it is not relia
The ex unit is the font x-height (height of its x character). I would not use this here. You should use the em unit. This is the actual font-height. The font-height is defined by setting the line-height property. So:
.container {
height: 3em; /* 1em for each visible line */
overflow: hidden;
}
Here is some more info on CSS length units: http://www.w3.org/TR/CSS21/syndata.html#length-units