Design comparison
Solution retrospective
Don't know how to center the old-price LOL.
Community feedback
- @AdrianoEscarabotePosted about 2 years ago
Hi MakiRyan, how are you?
I really liked the result of your project, but I have some tips that I think you will enjoy:
- images must have alt text unless it is a decorative image, for any decorative image each IMG tag must have empty
alt=""
and addaria-hidden="true"
attributes to make all the assistive technologies of the Web, as screen reader. Learn the differences between decorative/meaningless images vs important content. - Consider using rem for font size .If your web content font sizes are set in absolute units, such as pixels, the user will not be able to re-size the text or control the font size based on their needs. Relative units “stretch” according to the screen size and/or user’s preferred font size, and work on a large range of devices.
if you want to continue coding with px, you can download a very useful extension in vscode, it converts px to rem! link -> px to rem
The rest is great!
I hope it helps... 👍
Marked as helpful0@MakiRyanPosted about 2 years ago@AdrianoEscarabote thank you for your feedback. Big help for a newbie like me. 💯
0 - images must have alt text unless it is a decorative image, for any decorative image each IMG tag must have empty
- @jordy-bugabooPosted about 2 years ago
Hi for the alignment of the old price, I would suggest using flexbox:
You would need to create a parent element that will act as the flex container. I'm using a utility class u-flex.
A good reading would be: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
HTML:
<div class="c-price u-flex"> <div class="price-promo"> $149.99 </div> <div class="price-original"> $169.99 </div> </div>CSS .u-flex { display: flex; align-items: center; }
Marked as helpful0
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