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.
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.