Converting to Shorthand


As discussed in Lesson 2, "Using CSS Rules," shorthand properties are easier to write and maintain than longhand properties. They also make CSS files more concise.

The <p> element can be styled so that font-size, line-height, and font-family are declared as a single font property.

The introduction class can be styled so that font-style, font-weight, font-size, line-height, and font-family are declared as a single font property as shown in Listing 7.6.

Listing 7.6. CSS Code Containing the Shorthand Styles
p {     font: 80%/1.4 arial, helvetica, sans-serif; } p.introduction {     font: bold italic 110%/1.4 times, "times new roman", serif;     text-align: center;     color: #900; } 




Sams Teach Yourself CSS in 10 Minutes
Sams Teach Yourself CSS in 10 Minutes
ISBN: 0672327457
EAN: 2147483647
Year: 2005
Pages: 234
Authors: Russ Weakley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net