CSS Background-Position Property



CSS Tutorial  >  Background   >   Background-position

The background-position property specifies the position of the background. The values can be

  • A combination of [top,center,bottom] and [left,center,right].
  • Two percentage values: The first value indicates the horizontal percentage, and the second value indicates the vertical percentage.
  • Two position values: The first value is the absolute horizontal position, the second value is the vertical position.

Examples below:

body { background-image: url("yp.jpg");
  background-repeat: no-repeat;
  background-position: center center;
}
body { background-image: url("yp.jpg");
  background-repeat: no-repeat;
  background-position: 20% 20%;
}

Next: CSS Background-Repeat




Copyright © 2014   1keydata.com   All Rights Reserved   Privacy Policy