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

Blog Preview Card With CSS @scope

Lucas Carlesso•140
@lucarle
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?
img:not(p *) {
    display: block;
    max-inline-size: 100%;
  }

I think this is a smarter way to reset img. The best part is that you can wrap it in a @layer, so it doesn't matter if the specificity is higher.

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

I had a little problem with the illustration asset being a pixel higher than it should have been. After some research, I discovered that is a known bug in Figma when exporting an image from a non-integer coordinate.

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

I'm mostly insecure about the readability, so I would appreciate if you have any questions about the code, such as "why did you do this and not that?" or if you can point out any part that seems confusing or unnecessarily complex.

Useful Resources

  • CSS Scope by Miriam Suzanne
  • Inclusive Components / Cards / #The pseudo-content trick by Heydon Pickering
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 Lucas Carlesso'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

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