Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Blog preview card using the cascade a bit

Ryan Hardy•160
@ryyHardy
A solution to the Blog preview card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


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

I liked how I used the CSS cascade this time to clean up the CSS a bit for the text elements. I did not fully match the design because I read the text was supposed to be smaller on mobile and the dimensions of the card looked slightly different in the design files.

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

Organizing the text elements was difficult because they were similar, but had slight differences. I used a "p" selector to basically set a default for the paragraphs and I overwrote them slightly for each text element. That helped, but I still needed to use a lot of weird values for the units and I'm sure there is a better way.

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

I was wondering if I should have used different units for a lot of the spacing challenges I had. I tried to use a mix of em, rem, and % but I'm not sure if I did that correctly. Also, I feel like the CSS for the active states looks a little weird.

Also, I used a lot of descendant selectors like ".class1 .class2" and I'm not sure if there is an alternative or if it was even necessary to do that in most of them.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Ryan Hardy's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License