Styling this page with CSS Flex-box and also media-Queries
Design comparison
Solution retrospective
I tried to have three different media queries for each screen size but hopefully soon ill be using clamp and other modern CSS styling methods. Honestly, having an image with a color overlay was a bit of a headache and after some research, I couldn't do it any better. So I'll be grateful if anyone has any advice on that.
Community feedback
- @vanzasetiaPosted over 2 years ago
Hello there, @comendrun! 👋
You only need one media query to make the site responsive. Initial styling and another styling for a different layout. I highly recommend writing the styling using the mobile-first approach. It often leads to shorter and better performance code. Also, mobile users won't be required to process all of the desktop styles. So, the initial styling is for the mobile layout and then a media query for the desktop layout.
Before getting into the image overlay, I recommend using
picture
element because there are two versions of the image, mobile, and desktop. By usingpicture
you can decide which version of the image should appear based on the user's screen size. Then, you can usemix-blend-mode
and adjust theopacity
until it looks similar to the design. For your reference, you can see @DarrickFauvel's solution.That's it! Hope this helps.
Marked as helpful0@comendrunPosted over 2 years ago@vanzasetia Wow!Great advice, dear Vanza. I should definitely try what you said. And I really appreciate your advice and helpful advice, it really means a lot to me
0@vanzasetiaPosted over 2 years ago@comendrun Thank you! It's good to know that it's helpful for you! 😄
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