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

3 Column Preview Card Component

Nofar Aviv•120
@nofaraviv
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 a newbie in frontend development so it is only the desktop view. I still need to lead how to make responsive pages. Any comments or suggestions that help me improve are greatly appreciated.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Rayane•1,935
    @RayaneBengaoui
    Posted about 4 years ago

    Hello Nofar Aviv,

    Congrats for completing the challenge ! 🙂

    I'd like to suggest :

    • Add cursor: pointer to your buttons so they look clickable.

    • Add min-height: 100vh to your body to make sure it covers the area of the entire viewport. Then it will be easier for you to put your container in the middle of the page.

    • Look at CSS resets and the box model. There is initial padding and margin default, so usually people use CSS resets to remove those default behaviors. A good start is to use *{margin: 0; padding: 0; box-sizing:border-box }. You can also take a look at the MDN documentation on the box-model which is something very important to understand for CSS (https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing).

    • You can make your classes more generic. You use left-side, middle and right-side but those classes share a lot of common properties. So creating a card class that contains all shared properties and then creating more specific classes for colors could be a way.Thus, we would have something like : card orange , card lightgreen and card darkgreen.

    • There is no need to add border-radius to the cards as you can directly declare it on the container. I saw that you did it, but also on the cards, so you can remove it on cards and let it only on the container. However, it will not work directly because the edges of the container will be rounded, but cards will overflow it and we won't see the change. To avoid this, you can also add overflow: hidden to your container that will not display everything that overflow the container.

    • You are using float: left but here there is no need to use it so it can be removed. Generally, you won't have to use float ever. Nowadays, with flex, grid, ... You have all the necessary modern functionalities to make layout and positioning. Knowing of float works can still be useful if you have to work with older code bases.

    • When using a flex container it's better to use flex-basis property than width because it will be easier for flex items to resize if the container width changes. Here is a good article to understand what's the difference between width and flex-basis (https://mastery.games/post/the-difference-between-width-and-flex-basis/).

    • Add line-height property to your <p> tag to add spacing between lines.

    • Take a look at semantic HTML tags for better readability. Instead of using <div> elements only, there are plenty of other tags that describe your code better.

    Overall, well done for the challenge and good luck in making it responsive !

    Happy coding ! 😃

  • Arshad Gilani•15
    @arshad81
    Posted about 4 years ago

    For a better idea about making websites responsive checkout this video. It mght help you out https://youtu.be/srvUrASNj0s

  • Tejas•265
    @Tejas-117
    Posted about 4 years ago

    Solution looks pretty good!

    A small suggestion: Use common class for buttons and apply all common styling and hover state using it.

    -Happy coding :)

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 1st-party linked stylesheets, and styles within <style> tags.

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.

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

Oops! 😬

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

Log in with GitHub