Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This has to do with how "line-height" is being calculated on the div element. Setting the "line-height" of the div element to the same "font-size" as the span is a way to fix this issue. Like <a href="http://jsfiddle.net/NgLpf/23/" rel="nofollow">this</a>:</p> <pre><code>div { line-height: 12px; } </code></pre> <p>The Strict (and HTML5) DOCTYPEs <a href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height" rel="nofollow">seem to enforce</a> "line-height" as if it was "min-height". Even if there isn't any text within the element, "line-height" is still applied.</p> <p>The Transitional DOCTYPE triggers "Almost Standards" mode in browsers, which is basically <a href="http://hsivonen.iki.fi/doctype/#almoststandardsmode" rel="nofollow">standards mode with a few quirks</a>. </p> <p><a href="http://msdn.microsoft.com/en-us/library/ff405794%28v=vs.85%29" rel="nofollow">This page</a> explains the behavior of line height calculations in "Almost Standards" mode:</p> <blockquote> <p>Inline elements contribute to line height if and only if one of the following is true.</p> <p>If the element:</p> <ul> <li>Contains text characters</li> <li>Has a nonzero border width</li> <li>Has a nonzero margin</li> <li>Has a nonzero padding</li> <li>Has a background image</li> <li>Has vertical-align set to a value other than baseline</li> </ul> <p>Note that a line break is not considered a text character for this definition unless it is the only content of a line box. In that case, the line box height remains the uppermost inline box top and the lowermost inline box bottom on the line, regardless of the specified line height.</p> <p>If an <strong>img</strong> element is the sole content of a table cell, the line box height of the cell line box height is adjusted to zero.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload