3 Column Preview Card using Flexbox, CSS Grid, vanilla CSS & HTML.
Design comparison
Solution retrospective
next time I will research more about the grid system and how to use better the button label in HTML.
What challenges did you encounter, and how did you overcome them?I challenged myself to use the mobile-first methodology to build the design from small screens to large screens, with CSS Grid, I was able to give a nice touch to the design on medium screens
What specific areas of your project would you like help with?Any tip or comment is welcome, thanks!
Community feedback
- @Islandstone89Posted 2 months ago
Good job!
Some suggestions:
HTML:
-
The icons are decorative, meaning the alt text should be empty:
alt=""
. -
There should only be one
<h1>
on a page. Given there are 3 similar headings, I would change all of them into a<h2>
. -
Learn More" would navigate to another page, hence it is not a button but a link.
-
Wrap the footer text in a
<p>
.
CSS:
-
I would recommend adding
1rem
ofpadding
on thebody
, to ensure the card container doesn't touch the edges on small screens. Then, you can remove the margin on the card container. -
To center the card horizontally and vertically, I would use Flexbox on the body:
display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100svh;
-
Remove all heights, and all widths and max-widths in
%
. -
Instead, give the card container a
max-width
of around75rem
. -
I would set up the grid like this:
Default styles for mobile:
.article { display: grid; grid-template-columns: 1fr; }
Which on larger screens changes to
grid-template-columns: 1fr 1fr 1fr;
.Marked as helpful0 -
Please log in to post a comment
Log in with GitHubJoin 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