5% of the default font size. Also ensure you test your work at a range of text sizes
in various browsers, to ensure things still look OK if the text is zoomed in or out.
THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
82
p {
font-size: 1.1em;
line-height: 1.5;
}
The difference between the font-size and line-height measurements is the leading
value. Half the value is applied above the text and half below. Should you use a number
alone, rather than a length or percentage, that value is multiplied by the font-size setting
to define the line height. For example, if font-size is set to 10px and line-height is set
to 1.5, the line-height value becomes 15px.
Many web designers who have no graphic design experience ignore the line-height
property, but, as mentioned earlier, it??™s essential for improving the legibility of a web page.
In the following screenshots, the left images shows the default spacing and the right one
shows increased line height, resulting in increased legibility.
Defining font-style, font-weight, and font-variant
These three properties are straightforward. The first, font-style, enables you to set italic
or oblique text. The former is often a defined face within the font itself, whereas the latter
is usually computed. Typically, web browsers treat both the same, and only the italic
value is in general use (except for the occasional use of normal??”the default value??”in
order to override something set elsewhere).
Pages:
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157