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
- Solution URL: Solution URL here
- Live URL: Solution URL here
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
I use image tag with srcset attribute it was very useful for responsive design, you can use it like this:
<img
srcset="
images/image-product-desktop.jpg 1200w,
images/image-product-mobile.jpg 500w
"
/>
<!-- the first image shows for desktop and
second on shows for width lower than 500px(mobile and tablet) -->
- Frontend Mentor - @ashkan-zs