0👍
You should try background-size: contain. You should also set the width of the element to 100vw
instead of 100%
. That way the div will be the width of the screen.
So your code should look like this:
.home-hero {
background: url("https://i.postimg.cc/0NbqSxfQ/banner-image.png");
background-size: contain; /* This changed */
width: 100vw; /* This changed */
height: 100vh;
}
Source:stackexchange.com