Design comparison
Solution retrospective
kindly help my mobile imag is not showing in responsive.
Community feedback
- @CarlHummPosted over 1 year ago
Hello there
Your media queries are working, and your images are loading correctly.
Your
.containers
flex-direction property is set to row, so it is attempting to display.item1
, and.card-img
on the same row..item1
has nested content and fixed spacing measurements so has an implicit minimum width..card-img
is just a div with no nested content or minimum width. So as the screen size gets smaller,.card-img
shrinks to adapt, reducing in width.Eventually
.card-img
shrinks so much that it has no width, disappearing. This can be seen in this quick video, where as the screen shrinks, the image gets cut off like a closing curtain, or clipping mask.One of the ways to fix this would be to
- Set
.container
toflex-flow: column-reverse
on mobile viewports. - Set a minimum height for your image (when displayed as a row it inherits the flex containers height, so you need to set a height when stacking vertically)
- Add media queries for when screen size increases, and set
.container
toflex-flow: row
on desktop viewports. - Add a maximum width to your card element to stop it expanding.
When choosing to load a different sized image based on screen size, it might be worth checking out the picture element. It makes this very easy.
Marked as helpful0 - Set
- @OsauyiPosted over 1 year ago
It may be the url file path. If both of them works on your local server try using another path or check for errors on the mobile image path
0
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