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

Four card feature section with CSS Grid

R4PH431•110
@R4ph431-157
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?

Grid is cool to play with, took sometime for me to get this very challenge done, had to revisit some sources and learn some new tips and how to make everything work, happy I got the results I have now.. Will be playing around with Grid more often from now on

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

Had some challenge defining the rows, I was seeing the layout structure but wasn't sure about how best I'd define the rows lol, especially after I watched a youtube video of Kevin Powell about grid tips where he said a thing about 'not explicitly defining rows unless there's a need to'.. So I was like seeing the rows structure there and how I could span card1 and card4 through row 2 and 4 but was kinda unsure and rethinking other ways I'd get it done without explicitly defining rows, I tried defining my rows after sometime but again my results were coming out bigger than the original layout rows because I used repeat(5, 1fr) so I kinda looked closely and thought I could bring the 1fr down a bit since it was bigger than the original layout, so I settled with px.

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

Still unsure if defining my rows with a fixed unit (px) was a good decision but I'd love to hear any tips or ways to make anything better, if at all there's any

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Andrey•4,400
    @dar-ju
    Posted about 2 months ago

    Hi R4PH431!

    My opinion is not the only correct one, but if you fully control your layout with media queries, then you can use px in the project, as you did. Fonts, yes, it is recommended to use relative values, so that there are no problems with screen scaling.

    Personally, I layout like you in pixels, font and line-height - in rem. This allows me to work faster and layout close to the design layout.

    Perhaps there will be team projects, where the relative value is strictly regulated and you need to be ready for this.

    You have a great job!

    I have only 2 points that need to be worked on:

    • the top part is more of a header or div, for section at least one h2-h6 level header is required
    • look at the layout on a screen resolution of 1000px, the column with cards is too narrow and there is a lot of free space around, it is worth adding an additional media query, or making the cards wider

    Otherwise everything is great! Good luck in future projects!

    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