• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Working with Fonts > Using the Font Shorthand Property

Using the Font Shorthand Property

In CSS, the font shorthand property can be used to set the other font properties. These include the font-size, font-family, font-weight, font-style, and font-variant properties, as well as the line-height property (which is covered in the next chapter, “Working with Text and Links”). Any font properties not declared in the font property are reset to their initial values. Two CSS2 properties, font-stretch and font-size-adjust, for the sake of backward compatibility with browsers that only support CSS1, can only be used to declare their default initial values (normal and medium, respectively). Other values for these properties should be set as individual properties.

Here's an example of setting a style rule for the P element that sets the font size, line height, and font family (see Figure 7.14):


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint