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

Bam blocks, flexbox, grid, adaptive design

Khrystyna Horbenko•230
@KristinaHorbenko
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 challenges did you encounter, and how did you overcome them?

I encountered some difficulties arranging the cards in the desktop version.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Jocelyne Teles•180
    @JocelyneTeles98
    Posted 8 months ago

    Hello, @KristinaHorbenko!

    You did a great job! Referring to your difficulties, indeed it is difficult to arrange the cards as they are in the design. I want to share with you how I did and explain the logic a little bit. My solution might not be the best, but it serves as an idea:

    HTML: This part is the specific one of the cards. What I did here is to group the cards in the middle in the same <span> so I can put them together in the column of the middle (think about a grid with three columns and one row).

    <section>
          <div class="card" id="supervisor">
            <span>
              <h2>Supervisor</h2>
              <p>Monitors activity to identify project roadblocks</p>
            </span>
            <div class="image-container">
              <img src="images/icon-supervisor.svg" alt="supervisor icon" />
            </div>
          </div>
    
          <span class="middle-cards">
            <div class="card" id="team-builder">
              <span>
                <h2>Team Builder</h2>
                <p>Scans our talent network to create the optimal team for your project</p>
              </span>
              <div class="image-container">
                <img src="images/icon-team-builder.svg" alt="team builder icon" />
              </div>
            </div>
    
            <div class="card" id="karma">
              <span>
                <h2>Karma</h2>
                <p>Regularly evaluates our talent to ensure quality</p>
              </span>
              <div class="image-container">
                <img src="images/icon-karma.svg" alt="karma icon" />
              </div>
            </div>
          </span>
    
          <div class="card" id="calculator">
            <span>
              <h2>Calculator</h2>
              <p>Uses data from past projects to provide better delivery estimates</p>
            </span>
            <div class="image-container">
              <img src="images/icon-calculator.svg" alt="calculator icon" />
            </div>
          </div>
        </section>
    

    CSS Mobile: Here is how display the section in mobile screen sizes. This is simply a grid with one column .

    section {
        display: grid;
        row-gap: 1rem;
    }
    

    CSS Desktop: While in the desktop styles, I set this styles for the span of the cards in the middle to convert it a grid with one column. Then, the section is defined as a grid of 3 columns and the items are aligned to the centre.

    .middle-cards {
            display: grid;
            row-gap: 1rem;
    }
    section {
            align-items: center;
            grid-template-columns: repeat(3, 1fr);
            max-width: 80%;
    }
    

    I hope these examples of solution are helpful. They may not be the best because I'm learning too, but is something 😅 Happy coding! 😉

    Marked as helpful
  • Khrystyna Horbenko•230
    @KristinaHorbenko
    Posted 8 months ago

    This is a very interesting solution, and I appreciate the approach you've taken. I would love to see more examples like this to gain more experience. Thank you!

    Could you please explain why you used a <span> tag in this case?

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