Sams Teach Yourself HTML and CSS in 24 Hours (7th Edition)

There are several CSS style properties that can be used to alter the background of pages and individual elements on pages.

background

Usage

A shorthand property that allows you to set all the background properties in one declaration.

Values

background-color, background-image, background-repeat, background-attachment, background-position.

background-attachment

Usage

Determines whether a background image is fixed or scrolls with the rest of the page.

Values

scroll, fixed.

background-color

Usage

Sets the background color of an element.

Values

color-rgb, color-hex, color-name, TRansparent.

background-image

Usage

Sets an image as the background.

Values

url, none.

background-position

Usage

Sets the starting position of a background image.

Values

top left, top center, top right, center left, center center, center right, bottom left, bottom center, bottom right, x-% y-%, x-pos y-pos.

background-repeat

Usage

Sets whether and how a background image is repeated.

Values

repeat, repeat-x, repeat-y, no-repeat.

Категории