I'm building a small responsive page. On a page there is a background image with many buttons over it.
I added the following css to set the background image
.background{
height: 100vh;
width: 100%;
background: url('https://images.pexels.com/photos/1563564/pexels-photo-1563564.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260') no-repeat;
background-size: cover;
}
My problem is that when I resize the browser window, the buttons get stacked vertically and then the user can navigate to the bottom where the background image ends and then the user can see a big white space.
I'd like the background image to resize to fit the browser window when it is resized.
Any idea?
EDIT: I tried your suggestion with no help. I put my code in a StackBlitz page: https://stackblitz.com/edit/angular-y1avtu?file=src%2Findex.html
Resize the window and you will see the buttons to stack verticaly then scroll down and you will see a large white portion of the web page. This is what I don't want.