Design comparison
SolutionDesign
Solution retrospective
Hey guys! For me, it was a bit difficult at first to understand, how to change the image in desktop and mobile versions. Anyway, here's my solution for this challenge, it was pretty fun.
Community feedback
- @GalindezproPosted about 1 year ago
De la manera que escribistes las imagenes:
<img id="desktop-img" src="/images/image-product-desktop.jpg" alt="chanel gabrielle perfume"> <img id="mobile-img" src="/images/image-product-mobile.jpg" alt="chanel gabrielle perfume"> </div>``` debes eliminar "/" al principio y el css puedes usar "DISPLAY: NONE" en una de las imagines para ocultarla, cuando uses el media query y debas cambiar de imagen le aplicas el "DISPLAY: NONE" para ocultar la imagen que se estaba mostrando y "DISPLAY: INLINE-BLOCK" para mostrar la imagen oculta
Marked as helpful0 - @ratul0407Posted about 1 year ago
@feroztia congratulations on completing this challenge🎉🎉
It's great but you can make it even better:
- first you images aren't loading up because of the wrong source try this as the source
./images/image-product-desktop.jpg
and the same goes for the mobile image as well - To change the image for mobile and desktop versions you can do this
<picture> <source srcset = "./images/image-product-desktop.jpg" media="(min-width:600px)"> <img src="./images/image-product-mobile.jpg> </picture>
It will display the mobile image as default. But when the screen size increases to
600px
or above the desktop image will load up✌I hope it was helpful for you👍👍
Happy coding🙂🙂
Marked as helpful0 - first you images aren't loading up because of the wrong source try this as the source
- @AziraalDevPosted about 1 year ago
Hi! Try to update your repo and use "./" instead of "/" at the beginning of path for images.
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord