This is a solution to the Product 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 and focus states for interactive elements
- Live Site URL: View it here
- Semantic HTML5 markup
- Vanilla CSS
- CSS Grid
I used a simple CSS grid for the main layout. Most of the text alignment was done with the margin
property. One thing I was unsure about was how to change the image between desktop and mobile. In the process of doing research I came across the <picture>
tag, which is nifty. Another interesting technique I came across was using inline-flex
to center the button text.
- Frontend Mentor - @tadaly