Background positioning

What:

How to position a background image relative to the bottom or right side of the screen

How:

.bgimg {
    background-image: url('img.jpeg');
    background-position: right 10% bottom 76px;
}

The 10% is relative to the right of the screen, the 76px is relative to the bottom.

Where:

MDN Web Docs

Thoughts:

I’ve been doing this job for 18 years. I did not know that. I can’t believe it.

Leave a Comment