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-position — IE4 Y/Y | IE5 Y/Y | NN4 N/N | Op3 Y/-

Synopsis

This sets the starting position of a background image (defined by the value of background-image). background-position is used to set the origin of the background’s tiling, or its position if there is no tiling. Percentage values define not only a point within the element, but also the same point in the origin image itself; see Chapter 6 for more details.

Example

BODY {background-position: top center;}

Values

[<percentage> | <length>]{1,2} | [top | center | bottom] || [left | center | right]

Default

0% 0%

Inherited

no

Applies to

block-level and replaced

Percentage values refer to the size of the element itself as well as the size of the origin 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