Styling the <p> ElementThe font family is set using the font-family property. A range or fonts should always be included, separated by commas. A generic font family must be included at the end of the list. If a user does not have the initial font family, his or her browser will look for the second font family. If no font family matches are found, the browser will fall back to the generic font family. The font-size property will be set to 80%, which will make it 80% of the user's default browser style. Using percentages will allow the user to control the overall size of fonts (see Figure 7.3). Figure 7.3. Screenshot of styled paragraphs.
Finally, a line-height of 140% will be included to provide space between each line and make the text more readable. The default line-height for most browsers is 120%. Setting a value of 140% will add 20% additional space between each line. The rule set is shown in Listing 7.4. Listing 7.4. CSS Code Containing Styles for the <p> Elementp { font-family: arial, helvetica, sans-serif; font-size: 80%; line-height: 140%; } |