O'Reilly logo

Cascading Style Sheets: The Definitive Guide by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

background-color — IE4 Y/Y | IE5 Y/Y | NN4 B/B | Op3 Y/-

Synopsis

This sets the background color of an element. The color fills the content area and padding, and extends out to the outer edge of the element’s border. The value transparent trips across a nasty bug in Navigator 4.x, which interprets it as black.

Example

H4 {background-color: white;}
P {background-color: rgb(50%,50%,50%);}
PRE {background-color: #FFFF99;}

Values

<color> | transparent

Default

transparent

Inherited

no

Applies to

all elements

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required