Resize Background: Cover Anchor from Left to Right

I create a site on one page with an image that covers the entire background (and stretches proportionally to the window). For this, I use "background-size: cover;"

Now, when I resize the window to the smallest size, it allows me, the background image seems to snap to the top left corner by default.

Is there a way to change the snap location in the upper right corner?

+4
source share
1 answer

try changing css code like this:

body { background:#ffffff url('img_tree.png') no-repeat right top; margin-right:200px; } 

Here's a demo: http://www.w3schools.com/css/tryit.asp?filename=trycss_background_shorthand

+4
source

All Articles