Appendix C. CSS Properties

This appendix is a reference to the main CSS properties that you will be using to control the appearance of your documents.

For each property covered, you will first see a very brief description of the property and then an example of its usage. This is followed by two tables: the one on the left shows the possible values the property can take along with the first versions of Internet Explorer and Firefox to support these values, and the table on the right indicates whether the property can be inherited, what the default value for the property is, and which elements it applies to.

While browsers may support the inherit value of many properties, if the browser is unable to set the property to some other value in the first place (perhaps because that value is not supported), then the inherit value is of little use.

At the end of the appendix are units of measurement.

Font Properties

The font properties allow you to change the appearance of a typeface.

font

Allows you to set several font properties at the same time, separated by spaces. You can specify font-size, line-height, font-family, font-style, font-variant, and font-weight in this one property.

font {color:#ff0000; arial, verdana, sans-serif; 12pt;}

Value

IE

FF

Inherited

Yes

[font-family]

3

1

Default

n/a

[font-size]

3

1

Applies to

All elements

[font-style]

3

1

  

[font-variant]

4

1

  

[font-weight]

3

1

  

[line-height]

3

1

  

inherit

8

1

  

font-family

Allows you to specify the typefaces you want to use. Can take multiple values separated by commas, ...

Get Beginning HTML, XHTML, CSS, and JavaScript® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.