[ percentage |
length ] |
[ [ top |
bottom ] &|
[ left |
right ] ]
Compatibility: IE4+ N6
Version: Level 1
The background-position property allows you to determine the
initial position of a background image.
You can use any combination of a percentage or a length.
Alternately, you can use one of the keywords [top, center, bottom]
and/or one of the keywords [left, right, center] to define the
position. You cannot mix the keywords with percentage or length.
[ percentage &| length ]
The percentage value is usually listed as a pair of values.
Place a blank (white) space between the pair of percents. The first
percentage in the pair refers to the horizontal axis and the
second percentage to the vertical axis. 0% 0% is defined as the
left top corner and 100% 100% as the right bottom corner. If you only
give one percentage, it will only set the horizontal axis and
the vertical axis is defaulted to 50%.
Other examples of percentage pairs:
||right top corner
The length value can be in any of the following seven units.
Use the abbreviation.
Like the percentage pair, you usually use a pair of length
values The first length in the pair refers to the horizontal
axis and the second length to the vertical axis. The (0,0) position
is defined as the top left corner. If you only give one length, it will
only set the horizontal axis and the vertical axis is defaulted to 50%.
[ top |
bottom ] &|
[ left |
Instead of the length or the percentage values , you
can use keyword values to set the position. Again, you usually use a
pair of keywords. If you only use one keyword, the second value of the
pair is defaulted to center. Note that the order of the pair
of keyword values is not important. Thus, top center top, and
top center are equivalent and define the same image position.
You cannot mix keyword values, such as top, with percentage or length
background-position: 35% 80%;
background-position: 35% 2.5cm;
background-position: top right;
Click to see example in separate window
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.