Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 2 months ago

Responsive Blog preview card using Flexbox CSS

Raizo-03•50
@Raizo-03
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'm most proud of implementing a fully responsive design using CSS Flexbox and media queries. The layout adapts seamlessly from mobile (290px) to desktop (600px+) while maintaining the design integrity. I'm also proud of using proper semantic HTML structure and BEM methodology for scalable CSS architecture.

Next time, I would:

Plan the responsive breakpoints before starting development Use CSS Grid for the overall layout structure alongside Flexbox for component alignment

Implement the design mobile-first from the beginning instead of adjusting later

Add CSS custom properties for consistent spacing and typography scales

Include hover states for active states

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

Flexbox Alignment Issues: I struggled with understanding when to use align-items vs align-self and how the main/cross axis work with different flex-directions. I overcame this by creating small test cases and using browser dev tools to visualize the flex containers.

CSS Class Naming Conflicts: I had mismatches between HTML class names (content-article-author) and CSS selectors (.content-article__author). I learned to be more consistent with BEM naming conventions.

Responsive Image Sizing: The image container would grow but not the actual image. I solved this by learning about object-fit: cover and using percentage-based widths with max-width constraints.

Box Model Confusion: Adding padding increased the total width beyond my intended design. I learned about box-sizing: border-box to include padding within the element's width.

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

Accessibility: I'd like feedback on proper ARIA labels, focus management, and screen reader optimization for the card component.

Advanced Responsive Design: Help with implementing container queries and more sophisticated breakpoint strategies beyond basic media queries.

CSS Architecture: Feedback on my BEM implementation and suggestions for organizing CSS in larger projects.

Cross-browser Compatibility: Ensuring the layout works consistently across different browsers and devices.

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 Raizo-03'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