css 3

Icon

A comprehensive CSS 3 reference guide, tutorial, and blog
Are you a CSS expert? Want to contribute? Contact us

CSS BACKGROUND-POSITION-X

If a ‘background-image’ is specified, this property specifies the initial position on the X-axis of the background image specified in the browser window if it is not continuously tiled in the element’s rendering box. A minimum value for this property indicates the left side of the rendering box, and a maximum value is at the right side. The Y-axis component of the background position can be specified using the ‘background’, ‘background-position’ or ‘background-position-y’ properties.
 

Example

div.marked {
  background-image: url(watermark.jpg);
  background-position-x: center

 

Possible Values

Value Description
[Percentage] Percentage is in reference to the dimensions of the box of the current element. Value specifies the percentage on BOTH the image and the canvas and may be negative (eg: 20% indicates the reference point 20% from the left side of the image is to be located at 20% from the left side of the element’s rendering box
[Length] Represents an absolute X-coordinate position for the image and may be negative. Standard Absolute or Relative Length Units may be used here
left|center|right Keywords representing X-axis screen positions for image placement

 
 

2 Responses

  1. Marton Sari says:

    It’s not in the css 3 working draft, they dont plan to include it, so…

  2. Venkatesh says:

    how i can put the position 20px from right using css to manage my background image. layout type is flexible and div in which i want to give position is also on 100%.

    Please suggest it help me lot…

    thanks in advance!!!!!!

Leave a Reply

Pages

Sponsors

$100 PSD to XHTML. CONTACT US FOR MORE INFORMATION


CSS3.com



Please help CSS3.com stay alive and running

Bad Behavior has blocked 973 access attempts in the last 7 days.