
Responsive landing page using flexbox and CSS grid
Design comparison
Solution retrospective
I’m most proud of creating a pixel-perfect, responsive QR code component that matches the design for both mobile (375px) and desktop (1440px) viewports. Using Flexbox to center the card and media queries to adjust spacing was a great learning experience, and I’m happy with how clean the layout looks. Next time, I’d focus on adopting a mobile-first approach from the start, as I initially wrote the CSS for desktop and then adjusted for mobile. I’d also experiment with CSS variables to manage colors more efficiently.
What challenges did you encounter, and how did you overcome them?One challenge was getting the card’s proportions and spacing to match the screenshot exactly, especially the rounded corners and shadow. I overcame this by tweaking the border-radius to 20px and using a softer shadow with box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1). Another challenge was ensuring the design looked good on both 375px and 1440px viewports. I used media queries to adjust margins and font sizes slightly for mobile, ensuring the card didn’t feel cramped on smaller screens.
What specific areas of your project would you like help with?I’d like feedback on how to optimize my CSS for better maintainability, especially for managing colors and spacing. For example, should I use CSS variables or a utility-first approach like Tailwind CSS? I’d also appreciate advice on accessibility—how can I ensure the QR code component is accessible to screen readers, and are there better ways to handle the image’s alt text?
Community feedback
- @zh4rPosted 14 days ago
-
You haven't linked the font properly and it's defaulting to sans-serif.
Put this on the top of your styles file:
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,100..900;1,100..900&family=Outfit:wght@100..900&display=swap');
-
Instead of using divs for the container and card, you can use more semantic elements like
<section>
and<article>
for instance.
Otherwise, good job!
Marked as helpful0@Zakkur17Posted 13 days ago@zh4r Thank you very much, i will change the code now and implement the semantic elements in the project.
1 -
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