The CSS background-position-xproperty is used to set the initial horizontal position for the background image i.e. it is used to set an image at a certain position in a horizontal direction. The position is relative to the positioning layer, which can be set by using the CSS background-origin property.
left: It is used to set the image at the left position.
center: It is used to set the image at the horizontal center position.
right: It is used to set the image in the right position.
length: It is used to set the image at the horizontal position of the given length.
percentage: It is used to set the image at the horizontal position in terms of percentage height.
initial: It is used to set its default value. Its default value is 0%.
inherit: It inherits this property value from its parent elements.
Example 1: The following code demonstrates the CSS background-position-x property. The image is visible on the left side.
Please Login to comment...