Design comparison
Solution retrospective
Still, I have some problems with the mobile query, it doesn't look like the image-product mobile challenge request. The image is too long and it doesn't cover all the container space.
What specific areas of your project would you like help with?Need some help with the mobile query, it doesn't look like the image-product mobile challenge request. The image is too long and it doesn't cover all the container space.
Community feedback
- @beowulf1958Posted 4 months ago
Congratulations on completing this challenge! The desktop version looks good. However, it would look better if it were centered on the page, instead of pushed down 300px. check out this article. Also, the design calls for the image to be round on the left side. Try this:
.image{ /* display:flex; */ width:50%; overflow: hidden; border-radius: 15px 0 0 15px; } img{ max-width:100%; display: block; }
Now about the media query. You did a great job, it just needs a little tweak. To make the image go all the way to the top of the container, apply a negative margin; In the media query
.image{ width:100%; border-radius: 15px 15px 0 0; margin-top: -50px; }
The reason the image doesn't look right is that it is the wrong image. The heart of this challenge is to find a way to swap out the desktop image with the mobile image in the media query. There are several ways of doing this, but I think the simplest way is to use
display: none
anddisplay: block
to make the second image disappear.In the html, add both img to .image
<div class="image"> <img src="images/image-product-desktop.jpg" alt="Parfum name Gabrielle Chanel brand " class="desktop"> <img src="images/image-product-mobile.jpg" alt="Parfum name Gabrielle Chanel brand" class="mobile"> </div>
Hide the mobile image with
.mobile { display: none; }
Then in the media query, switch them up:
.desktop{ display: none; } .mobile{ display: block; }
Hope this helps. Keep on coding.
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