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

Four card feature using flexbox, tailwindcss

tailwind-css
Rafael Ibarra•120
@rafbar2000rr
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 am proud of learning responsive design. I would try to improve my code, making it cleaner.

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

It was a little difficult to arrange the cards when the screen size crossed the breakpoint, I overcame by using flexbox resources.

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

I would like to know if there is a better way to code for the cards arrangements when the screen crosses the breakpoint from mobile to desktop. I did it using flexbox but I am not sure if using grid could be easier.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Jaylen Baxter•340
    @JYLN
    Posted 9 months ago

    Overall, this is a great start! Here are a few things I noticed that you could potentially improve upon:

    • You're using static pixels for the majority of your sizes. When a user is zoomed in or has their browser configured with a different font-size, your layout may look strange. You may consider converting your sizes into variable sizes (rems or ems) to allow for more consistent layout in these cases.
    • Your icons within the cards are not positioned correctly according to the design. It appears you attempted to position them with the justify-self-end utility class, however the parent element for the card is not using the grid utility class to allow the utility class to position your icon. You may want to refer to the Tailwind docs and choose your best approach with either grid or flexbox, then update the cards.
    • You may consider adding padding to your body element as when the screen resizes, your content is smashing into the sides of the viewport.
    • You may consider only setting bottom margin on elements when you're attempting to space out your elements. I usually find it allows me more control over where elements are positioning themselves after the spacing when using this method rather than setting a top and bottom margin on intersecting elements. Likely just a preference though.
    • As accessibility is concerned, I've learned it's best practice to make the alt attribute on your images as descriptive and specific as possible if the image is not a decorative image (otherwise you'd leave the alt empty). I would say in this case, the icons are decorative, but if you choose to leave the alt, make sure they are more descriptive as screen readers will utilize your alt tag to describe the image.
    • I noticed you're linking some other Google fonts that you are not using within the project. You may consider refactoring your links so that just Poppins is being loaded as that's the primary font that's being used. Browsers will use whichever sans-serif font is selected in their settings as fallback rather than what else is linked unless specified.

    These are just a few things I noticed and figured I could comment on based on the learning and feedback I've received on previous challenges. Great work!

    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

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