CSS background-size cover and background-position

Ivo picture Ivo · Dec 18, 2012 · Viewed 81.7k times · Source

HTML:

I'm using a images as a background image, only the lower part of the image is more important than the top.

How can I make the background go up a little?

Answer

Stéphane Bruckert picture Stéphane Bruckert · Dec 18, 2012

If the bottom is more important: background-position: bottom;

background-position also allows percentage values: 0% 0%; by default.

The first value is the horizontal position and the second value is the vertical. The top left corner is 0% 0%. The right bottom corner is 100% 100%. If you only specify one value, the other value will be 50%.

You should try background-position: 0% -10%;