Design comparison
Solution retrospective
Hey Guys,
Would appreciate your comments regarding my code. Anything I could have improved or written better?
One thing that doesn't seem to work is the srcset in my hero img. On mobile widths it doesn't change the image to the mobile one. I'm not sure if I have written it correctly, or maybe I'm not understanding it right. Would appreciate some help on this one. Thanks :)
Community feedback
- @GrzywNPosted over 2 years ago
Great job!
You can use something like this and convert it into JSX:
<picture> <source srcset="path/to/desktop.png" media="(min-width: 60em)"> <img src="path/to/mobile.png" alt=""> </picture>
or change
content: url(path);
for your image element in the SCSS / CSS :)Of course your default source should be consistent with your current approach. Mobile-first have a mobile source by default etc. I think it's obvious, but yeah :)
Have a nice day and happy 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