This is a solution to the 3-column preview card component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout depending on their device's screen size
- See hover states for interactive elements
- Solution URL: Add solution URL here
- Live Site URL: Add live site URL here
- Layouting URL: https://www.figma.com/file/4tEwB3bqxt8wstjhifyDT8/Fontend-Mentor---3-Column-Preview-Card-Component-Main?node-id=1%3A5
In this challenge, I'm only using vanilla HTML and CSS to work with the solution. My goal is to be as close as possible as the design. First, I put the design pictures to Figma to measure the layout. Then, I code the structure of the page. After that, I code the stylesheet. I managed to implement hover states to the buttons easily. The challenge came when I tried to apply my measurement to my code. I tried Flexbox at first, but it was difficult to get the satisfying result. Suddenly it became a hard math. As I lost my track, I reorganized my code into Grid. I used Grid not only for the elements, but also the white spaces as well.
- Semantic HTML5 markup
- CSS custom properties
- CSS Grid
In this challenge, I learned how powerful is the Grid system. I managed to use Flexbox before this one, but the code was messy. Using Grid system, I can apply my measurement easily and code more orderly.
I want to improve my understanding of using HTML and CSS in general and from this challenge, specifcally Flexbox and Grid. Although in this challenge I found it is easier to use Grid, I think Grid by no means is an overall solusion to layouting.
- https://developer.mozilla.org/en-US/docs/Web/CSS/:root - I found using :root pseudo-class to declare Global CSS Variable helps me organizing variables such as colors.
- Frontend Mentor - @hattami98