Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

Responsive 3 columns card component

NadiaFr•310
@NadiaFrShLm
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 still a newbie, dont judge me stricktly :) I stucked with some questions here. scema of the body: "body" "div.container" "main.card" "div.copyright" "/ div.container"
"/ body" First of all, width and height to make the card component right in the center of the screen (+ "div.copyright" always at the bottom). So, am I right to give the "div.container" (that is a only child of a <body>) hight of 100vh. In this case whole contains will take 100 screen height, and with "display: flex" I cant disperse 2 child ("main.card" itself and "div.copyright") on the screen. In the other hand, I have to add "margin: 0 auto" and to the "div.container" and to it's first child "main.card" to center vertically.

Second, CSS variables. I gave button { background: hsl(31, 77%, 52%); /* to apply the background color*/ --class-item-bg: hsl(31, 77%, 52%); /* to reuse this color later at the :hover state*/ it works but I'm sure there is an other much more clewer way to do it.

Third, I add all the parameters of all the component at the top of the .css file. Is it useful/ necessary in a real life project?

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on NadiaFr's solution.

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
  • Use cases

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