Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive landing page in CSS

@meghaspatil1

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

Making the site responsive is one of the many improvements I am proud of having made. I want to create a challenge more quickly the next time.

What challenges did you encounter, and how did you overcome them?

Well, challenges I faced were quit easy; by researching the article again and again, I managed it.

What specific areas of your project would you like help with?

Well, while reading about media queries in part of the grid section, I was not able to use grid-gap and box-shadow: var(--generic-shadow). May I know why?

Community feedback

P
Steven Stroud 4,120

@Stroudy

Posted

Amazing job with this! You’re making fantastic progress. Here are some small tweaks and possible solution to your problem…

  • What does your variable look like? box-shadow: var(--generic-shadow)

  • box-shadow: 0px 0px 16px hsla(229, 6%, 66%, 0.5);

  • Break down

  • 0px 0px: The shadow is centered both horizontally and vertically (no offset).

  • 16px: The shadow has a soft blur effect with a 16px radius.

  • hsla(229, 6%, 66%, 0.5): The shadow color is a semi-transparent, light gray-blue.

  • The grid-gap property was renamed to gap in the CSS Grid specification. While grid-gap is still supported in some browsers for backward compatibility, it’s best to use gap for future-proofing your code. Try replacing grid-gap with gap in your media query.

  • Using max-width: 100% or min-width: 100% is more responsive than just width: 100% because they allow elements to adjust better to different screen sizes. To learn more, check out this article: responsive-meaning.

  • Developers should avoid using pixels (px) because they are a fixed size and don't scale well on different devices. Instead, use rem or em, which are relative units that adjust based on user settings, making your design more flexible, responsive, and accessible. For more information check out this, Why font-size must NEVER be in pixels or this video by Kevin Powell CSS em and rem explained.- Another great resource for px to rem converter.

  • Using rem or em units in @media queries is better than px because they are relative units that adapt to user settings, like their preferred font size. This makes your design more responsive and accessible, ensuring it looks good on different devices and respects user preferences.

You’re doing fantastic! I hope these tips help you as you continue your coding journey. Stay curious and keep experimenting—every challenge is an opportunity to learn. Have fun, and keep coding with confidence! 🌟

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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