@elaineleung
Posted
Hi Jax, could you use background-size: cover
with width and height set to 100% and then set the responsive width and height that you want in a parent container (as in, the div with the background image would be contained within an image container)?
You can also try a picture
element instead of background image, since you can include images of different sizes along with the media query you want them shown at:
<picture>
<source media="(min-width: 960px)" srcset="image-desktop.png" />
<img src="image-mobile.png" alt="perfume bottle" />
</picture>
Hope this helps!
Marked as helpful