CSS background-position Property


The body-position property in CSS is mostly used to place an image.

Syntax

Example

Preview

Property Values

Value Description
left top 
left center 
left bottom 
right top 
right center 
right bottom 
center top 
center center 
center bottom 
 
If you only supply one keyword, the default value is "center."
x% y% The first number represents the horizontal position, while the second represents the vertical position. The upper left corner has a value of 0% 0%. The bottom right corner is 100 % 100 %. If you just enter one value, the other value will be 50%. 0 %.0 %.is the default value.
xpos ypos The first number represents the horizontal position, while the second represents the vertical position. The top left corner has a value of 0 0. Pixels (0px 0px) or any other CSS unit can be used as units. If you just enter one value, the other value will be 50%. You can combine percentages and positions.
initial This attribute is set to its default value.
inherit This attribute is inherited from its parent element.

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
background-position 1.0 1.0 1.0 4.0 3.5