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: https://github.com/Tripex48/FEM_Product-preview-card-component
- Live Site URL: https://Tripex48.github.io/FEM_Product-preview-card-component
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
I learned about the HTML <picture>
tag and how it gives web developers flexibility in specfying image resources. Instead of having one image that is scaled up or down based on the viewport width, multiple images can be designed to more nicely fill the browser viewport.
<picture>
<source media="(max-width:650px)" srcset="image-product-mobile.jpg" />
<img src="image-product-desktop.jpg" alt="Gabrielle Parfum" />
</picture>
- CSS reset - A great modern CSS reset that ensures a clean (default) start to any web development project.
- Learn flexbox the easy way - A video from Kevin Powell discussing the properties and workings of CSS Flexbox.
Thank you to FrontEnd Mentor for providing this challenge.