Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 29 days ago

Responsive four card feature section master with bootstrap

bootstrap
Leyanis Díaz•220
@LeyaDiaz
A solution to the Four card feature section 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 how I managed to replicate the desktop layout with accurate alignment and spacing between the cards. It was challenging at first, but once I figured out the right HTML structure and CSS adjustments, the design came together nicely. I also feel proud that I’m starting to apply best practices instinctively, such as using CSS custom properties and thinking mobile-first.

Next time, I would spend more time planning the layout structure before coding, especially for complex desktop designs. This could help me avoid trial-and-error and speed up the process. I’d also like to experiment more with CSS Grid to handle card arrangements more efficiently.

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

The main challenge was aligning the cards correctly on desktop screens, especially ensuring the center cards had the right spacing between them and balanced margins with the side cards. Initially, the cards looked uneven and the spacing felt off.

I overcame this by carefully analyzing the design and using Bootstrap’s grid system along with custom CSS media queries. Adding padding and gap adjustments inside the media query helped me achieve the desired layout. Also, limiting the paragraph width in the header improved readability and matched the design better.

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

I would appreciate feedback on how to optimize the layout for desktop screens, particularly:

Are there more efficient ways to manage spacing between cards without relying heavily on padding and margin tweaks?

Would using CSS Grid instead of Flexbox and Bootstrap grid improve the responsiveness or maintainability of the layout?

Any tips on structuring media queries for complex multi-column layouts to keep the CSS clean and scalable?

Additionally, I’m open to suggestions on improving accessibility and semantic HTML in this kind of card-based layout.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Harsh Kumar•3,510
    @thisisharsh7
    Posted 28 days ago

    Great job on solving Four card feature section challenge! Your mobile-first approach and CSS custom properties reflect strong best practices.

    Suggestions:

    • Card Spacing Optimization: Instead of padding/margin tweaks (e.g., .cards { padding: 2rem }), consider CSS Grid with gap (e.g., grid-template-columns: repeat(3, 1fr); gap: 2rem) for consistent spacing. This simplifies layout management without relying on Bootstrap’s grid.
    • CSS Grid vs. Bootstrap/Flexbox: Using CSS Grid (display: grid) for .box instead of Bootstrap’s row-column system would improve maintainability. Define grid-template-areas for explicit card placement, enhancing scalability for complex layouts.
    • Single Styling Approach: Mixing Bootstrap and custom CSS (e.g., .cards styles) can lead to conflicts. Choose one method: either fully leverage Bootstrap’s utilities (e.g., p-4, mb-3) or use pure CSS for better control and consistency. Consolidate into style.css for clarity.
    • Media Query Structure: Group related styles under one @media block (e.g., @media (min-width: 1200px)) to keep CSS scalable. Use consistent min-width breakpoints (768px, 1200px).
    • Accessibility/Semantics: Use <h3> for .name instead of <h2> to maintain heading hierarchy after <h1>. Add aria-labels to images (e.g., alt="Supervisor icon").

    Tip: Add hover effects (e.g., .cards:hover { transform: scale(1.05); transition: transform 0.3s ease; }) for visual look.

    Excellent work overall!

    Marked as helpful

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
Frontend Mentor logo

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub