How to reset DIV offsetHeight when contained text font is reduced

206 Views Asked by At

I have a <div> that is used to determine the vertical space required by an arbitrary text string. By default, the height of the <div> box grows to accommodate the text, including wrapped lines, etc.

If I increase the font size of the contained text, the <div> height will grow nicely as required.

However, not the other direction. If I reduce the font size, the <div> offsetHeight maintains a high-water-mark value.

True for Firefox and Chrome at least.

Is there a strategy for coercing the browser to adjust downwards?

0

There are 0 best solutions below