@Rhinozer0s
Posted
Hello Adriana βοΈ
I have a recommendation to solve your issue with the background.
For responsiveness it is usual to use the Picture-element
-
The <picture> element contains two tags: one or more <source> tags and one <img> tag.
-
in the <source> tag you can define your media queries
In your case it could look like this:
<picture>
<source media="(max-width:600px)" srcset="images/image-product-mobile.jpg">
<source media="(min-width:600px)" srcset="images/image-product-desktop.jpg">
<img src="images/image-product-desktop.jpg" alt="Product">
</picture>
I hope you find this helpful π Above all, the solution you submitted is great !
Happy coding!
Marked as helpful
@AdrianaMagdalena
Posted
Hi! Thank you so much! I used this solution while revamping the project today and I'll surely use it in the future too, a lot more intuitive than mine π
@VCarames
Posted
@Rhinozer0s
You only need one source
; In this case it would be the "desktop" image.
@Rhinozer0s
Posted
@vcarames
thanks for correcting me π€