I found it difficult to switch images from the mobile to the desktop and I guess understanding max-width in CSS... will look at it keenly.
Vinícius Massari
@ViniciusMassariAll comments
- @Maxino22Submitted over 1 year ago@ViniciusMassariPosted over 1 year ago
Hello ! There is a tag in html named <picture> and the common use for this tag is deal with responsive images and you can use that to change the image based on screen width.
You can learn how to use it in
https://www.w3schools.com/tags/tag_picture.asp
feel free to check my html code here
<div class="product-photo"><picture> <source media="(min-width: 30rem)" srcset="./img/image-product-desktop.jpg" /> <img src="./img/image-product-mobile.jpg" alt="" /> </picture>
check the use in tailwind too :) hope this helps
Marked as helpful0 - @Abgail-DinizSubmitted almost 2 years ago
Tive dificuldade em realizar a responsividade do site, pois quando diminui a tela a imagem sai da div.
@ViniciusMassariPosted almost 2 years agoOlá, o que está acontecendo com a imagem é que você colocou uma medida fixa nela, então quando o container principal encolhe muito a imagem estoura o container, geralmente o max-width para imagens usamos max-width de 100%, assim o tamanho máximo dela será de 100% tornando ela responsiva
Marked as helpful1