HTML and CSS Reference
In-Depth Information
The
line-height
property defines the height of each line of text (line
box). Leading, or vertical spacing between each line, is created by specify-
ing a
line-height
that is larger than the content height (
font-size
).
■
normal
: A reasonable default value specified by the browser;
commonly
1.2
■
<number>
: A numeric multiplier applied to the font size to calculate the
line-height
■
<length>
: A specific length value
■
<percentage>
: A percentage of the element's
font-size
The
font
shorthand property allows for assigning the indi-
vidual font properties (
font-style
,
font-variant
,
font-weight
,
font-size/line-height
,
font-family
) in the same place. Note that
although most shorthand properties allow for individual property values
to be left out and assume the default or inherited value, at minimum
font-size
and
font-family
must be declared. Also, the value of the
line-height
property must be paired with the
font-size
value in the
format of
font-size/line-height
, such as
1.2em/1.4
.
body { font: normal normal normal 20px/1.2em sans-serif; }
/* italic small-caps bold 80px/80px Georgia, serif; */
body>h1 { font: italic small-caps bold 4em/1 Georgia, serif; }
/* normal, normal, 400, 40px/47.3px, Arial, sans-serif */
body>h2 { font: normal 2em Arial, sans-serif; }
(continues on next page)