O'Reilly logo

CSS: The Definitive Guide, 3rd Edition 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

Appendix A. Property Reference

Visual Media

background

This is a shorthand method to express all of the individual background properties within a single declaration. Use of this property is generally encouraged over the individual properties, as it has a slightly better support profile in older browsers and doesn't take as long to type.

Values:

[ <background-color> || <background-image> || <background-repeat> || <background-attachment> || <background-position> ] | inherit

Initial value:

Refer to individual properties

Applies to:

All elements

Inherited:

No

Percentages:

Values are allowed for <background-position>

Computed value:

See individual properties

background-attachment

This property defines whether the background image scrolls along with the element when the document is scrolled. This can be used to create "aligned" backgrounds; see Chapter 9 for more details.

Values:

scroll | fixed | inherit

Initial value:

scroll

Applies to:

All elements

Inherited:

No

Computed value:

As specified

background-color

This sets a solid color for the background of the element. This color fills the content, padding, and border areas of the element, extending to the outer edge of the element's border. Borders that have transparent sections, such as dashed borders, will show the background color through the transparent sections.

Values:

<color> | transparent | inherit

Initial value:

transparent

Applies to:

All elements

Inherited:

No

Computed value:

As specified

background-image

This places an image ...

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