Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 4 years ago

3 Column Preview Card with CSS Flexbox

Jason Nham•20
@JasonNham
A solution to the 3-column preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I'm new to CSS designs and I want to become a web developer. Any tips on ways I could reformat my code, or tools I could've used would be much appreciated.

Thank you so much for your time.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Account deletedPosted about 4 years ago

    hey Jason, I have no suggestions. but I want your help. I've been stuck with this challenge. I am using bootstrap card layout and row and columns to complete this challege. col-sm-12 property works to certain screen size then the cards reset to their original layout at the smallest resolution. Below is my code. you can check. please help me.

    <div class="row"> <div class="col col-lg-4 col-md-4 col-sm-12"> <div class="card"> <div class="card-header"> <img src="images/icon-sedans.png" alt=""> </div> <div class="card-body"> <h1>Sedans</h1> <p>Choose a sedan for its affordability and excellent fuel economy. Ideal for cruising in the city or on your next road trip.</p> </div> </div> </div>
    <div class="col col-lg-4 col-md-4 col-sm-12">
      <div class="card">
        <div class="card-header">
          <img src="images/icon-suvs.png" alt="">
        </div>
        <div class="card-body">
          <h1>SUVs</h1>
          <p>Take an SUV for its spacious interior, power, and versatility. Perfect for your next family vacation and off-road adventures.</p>
        </div>
      </div>
    </div>
    
    <div class="col col-lg-4 col-md-4 col-sm-12">
      <div class="card">
        <div class="card-header">
          <img src="images/icon-luxury.png" alt="">
        </div>
        <div class="card-body">
          <h1>Luxury</h1>
          <p>Cruise in the best car brands without the bloated prices. Enjoy the enhanced comfort of a luxury rental and arrive in style.</p>
        </div>
      </div>
    </div>
    
    </div>
  • George•10
    @georgelowe
    Posted about 4 years ago

    Hey Jason with regards to corner rounding of the cards you might want to do this:

    .orange.card { border-radius: 10px 0px 0px 10px; }

    .very-dark-cyan.card { border-radius: 0px 10px 10px 0px; }

    Then do a media query for when they are displayed vertically like so:

    .orange.card { border-radius: 10px 10px 0px 0px; }

    .very-dark-cyan.card { border-radius: 0px 0px 10px 10px; }

    That way, when the cards are next to each other the left two corners of the orange and right two corners of the dark card are rounded, but when vertical its the top and bottom two instead

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

Oops! 😬

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

Log in with GitHub