Name

background — IE4 P/Y | IE5 Y/Y | NN4 P/P | Op3 P/-

Synopsis

A shorthand way of expressing the various background properties using a single rule. Use of this property is encouraged over the other background properties because it is more widely supported and doesn’t take as long to type.

Example

BODY {background: white url(bg41.gif) fixed center repeat-x;}
P {background: #555 url(http://www.pix.org/stone.png);}
PRE {background: yellow;}

Values

<background-color> || <background-image> || <background-repeat> || <background-attachment> || <background-position>

Default

refer to individual properties

Inherited

no

Applies to

all elements

Percentage values allowed on <background-position>.

Get Cascading Style Sheets: The Definitive Guide 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.