Submitted over 1 year ago
Product Preview Card Component Only Using HTML and CSS
@RizkiB12
Design comparison
SolutionDesign
Solution retrospective
What did you find difficult while building the project?
- Let me know how to use best @media for mobile
Do you have any questions about best practices?
- Please all in the front end mentor review my code, and what should i add for my work to build this
Community feedback
- @fernandolapazPosted over 1 year ago
Hi π, perhaps some of this may interest you:
HTML π§±, ACCESSIBILITY β:
- The main content of every page (the card in this case) should be wrapped with the
<main>
tag.
- No need to wrap each element with a
<div>
, better to use semantic elements like<img>
,<h1>
or<p>
directly.
- There are two images for this challenge, and to show different images depending on the device or screen size, the
<picture>
element is ideal:
<picture> <source media="(min-width: 680px)" srcset="images/image-product-desktop.jpg"> <img src="images/image-product-mobile.jpg" alt="description"> </picture>
- The icon is a decorative image and therefore needs an empty
alt
attribute to be ignored by a screen reader.
CSS π¨:
- It might be good to get used to designing with the mobile first approach, which means designing for mobile first and then for desktop or any other device, as it is widely considered best practice.
I hope itβs useful π
Regards,
Marked as helpful1@RizkiB12Posted over 1 year ago@fernandolapaz Hello, thank you so much about your review, may God bless you
0 - The main content of every page (the card in this case) should be wrapped with the
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