CSS background-position property

Usage

Sets the starting position of the background image.

Values

  • top left
  • top center
  • top right
  • center left
  • center center
  • center right
  • bottom left
  • bottom center
  • bottom right
  • [x% y%] - horizontal and vertical position expressed as a percentage of the element overall size
  • [xpos ypos] - horizontal and vertical position expressed in any CSS units such as pixels or ems

Example

Code:

body {
  background-image: url(background.jpg);
  background-position: top right;
}

body {
  background-image: url(background.jpg);
  background-position: 100px 200px;
}