title: Setting the height to a div to a multiple of line height
body: <p>How do you express the height of a div as a multiple of its line height in pure CSS without hard-coding line height or font size?</p>
  
  <h2>Background</h2>
  
  <p>I have a box (a DIV) that contains status text. The text will sometimes span multiple lines and often need only one. The status is updated several (five) times per second and this causes the bottom border and everything below the box to "jump" up and down as the box changes size to fits its contents.</p>
  
  <p>One solution to the jumping would be to set the min-height of the DIV to the height of two lines. Status text with more than two lines is rare so that degree of jumping would be acceptable.</p>
  
  <p>Alternatively I could set the height to the exact height of two lines and use overflow:hide to truncate the text. That would eliminate all jumping at the expense of some information.</p>
  
  <p>Which raises the question: How do I express height as a multiple of line height? The status text inherits its appearance from the global style sheet and does not know font size, family, line height, or anything.</p>
  
  <h2>Half-solution</h2>
  
  <p>I can use the em unit to express height without knowing anything about the font but that still leaves the line height property which also affects the final line height.</p>
  
  <p>Ideally I would prefer to inherit line height but if I override it to a known multiplier then I can force the box to become exactly two lines tall.</p>
  
  <pre><code>.progressStatus
  {
      line-height: 1.1;
      height: 2.2em;
  }
  </code></pre>
  
  <p>This solution is good enough for my needs but I'm curious if there's a better solution that does not involve javascript.</p>