MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Compare Revisions

line-height

Change Revisions

Revision 480379:

Revision 480379 by tregagnon on

Revision 480535:

Revision 480535 by tregagnon on

Title:
line-height
line-height
Slug:
Web/CSS/line-height
Web/CSS/line-height
Tags:
"CSS", "NeedsLiveSample", "CSS Reference", "CSS Référence"
"CSS", "NeedsLiveSample", "CSS Reference", "CSS Référence"
Content:

Revision 480379
Revision 480535
n87      <li>Prefer a unitless number:n87      <li>Prefer a unitless number
88      </li>
89    </ul>
88        <pre class="brush: html">90    <pre class="brush: css">
89&lt;style&gt;
90      .green { font-size: 15px;  line-height: 1.1;  border: solid91.green { font-size: 15px;  line-height: 1.1;  border: solid limeg
> limegreen; }>reen; }
91      .red   { font-size: 15px;  line-height: 1.1em;  border: sol92.red   { font-size: 15px;  line-height: 1.1em;  border: solid red
>id red; }>; }
92      h1     { font-size: 30px; }93h1     { font-size: 30px; }
93      div    { width: 19em;  display: inline-block; }94.box   { width: 19em;  display: inline-block; }
94&lt;/style&gt;95</pre>
95 96    <pre class="brush: html">
96&lt;div class=green&gt;97&lt;div class="box green"&gt;
n101&lt;div class=red&gt;n102&lt;div class="box red"&gt;
t109        <div style="display:inline-block; width:19em; font-size:1t110    <p>
>5px; line-height:1.1; padding:0.2em; border:solid limegreen;"> 
110          <h4 id="Avoid_unexpected_results.2C_use_unitless_line-h111      {{ EmbedLiveSample('Notes', '', '', '') }}
>eight!" style="font-size:30px; border:none; margin:0.6em 0"> 
111            Avoid unexpected results, use unitless <strong>line-h
>eight</strong>! 
112          </h4><code>em</code> values and <code>&lt;percentage&gt
>;</code> line-heights have poor inheritance behavior, and should  
>almost never be used in practice. Stick to unitless line-heights  
>(such as "<code>1.1</code>"). 
113        </div>
114        <div style="display:inline-block; width:19em; font-size:1
>5px; line-height:110%; padding:0.2em; border:solid red"> 
115          <h4 id="Avoid_unexpected_results.2C_use_unitless_line-h
>eight!" style="font-size:30px; border:none; margin:0.6em 0"> 
116            Avoid unexpected results, use unitless <strong>line-h
>eight</strong>! 
117          </h4><code>em</code> values and <code>&lt;percentage&gt
>;</code> line-heights have poor inheritance behavior, and should  
>almost never be used in practice. Stick to unitless line-heights  
>(such as "<code>1.1</code>"). 
118        </div>
119      </li>
120    </ul>112    </p>

Back to History