XML technologies / CSS / Advanced websites with CSS / CSS property reference / background-position-x, background-position-y

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The properties background-position-x and background-position-y are not part of the CSS specification and are interpreted only by Internet Explorer! They independently set vertical (Y-axis) and horizontal (X-axis) positioning of an element. Using them makes sense only with Dynamic HTML for Internet Explorer.

Inherited: no

See also: background-position

Values

Like background-position, both properties accept measurements, percentages and the constants in the table Value constants for background-position.

Default value: 0

Compatibility

CSS version: not part of the CSS standard

Supported only by Internet Explorer 4 and later.

Example

The following rule centres the background image horizontally and positions its top edge 20 pixels below the top of the body element:

body {
 background-position-x: center;
 background-position-y: 20px;
}

  

 

 

 

back to top