Design comparison
Solution retrospective
This challenge was a tough one, but I feel as though I have a close fit to the desired product. I did have some troubles setting all the elements to the correct sizes, it was a lot of trial and error. I have noticed that there is a small issue with the image when viewing the component in a small window on a desktop, but it still looks like it should on my mobile device. I am not sure if this is because of the <picture> element or my media query.
Any feedback regarding these topics or general ways to improve my solution are most certainly welcome!
Community feedback
- @MelvinAguilarPosted about 2 years ago
Hi @INS140 π, good job completing this challenge! π
I have some suggestions you might consider to improve your code:
- Update your <picture> element with 600px instead of 400px:
<source media="(min-width: 600px)" srcset="./assets/images/image-product-desktop.jpg">
- Use
min-height: 100vh
to thebody
selector instead ofheight
. This property lets you set a height and let the element grow even more if necessary.
- For specificity reasons you should work better with classes since they are reusable, and you can leave the ID when you work with Javascript.
- You could use the <del> tag to display the old price:
<del> <span class="sr-only">Old price: </span>$169.99 </del>
Note that I added the <span> with the
sr-only
class to thedel
element, this will provide more information about what your old price is about.The
sr-only
class is a class that you can add to hide content visually but is only visible to screen-readers.Above all, the project is done wellπ. I hope those tips will help you! π
Good job, and happy coding! π
Marked as helpful0@INS140Posted about 2 years ago@MelvinAguilar Thank you for the great feedback! The advice you gave me fixed that bug I had with the picture element. I'll keep in mind that images need to change at the same interval as media queries. I also read the article you attached and found it very interesting. I hadn't considered the use of a screen reader when designing the pricing section. I plan to pay more attention to details like this in my future projects.
1@MelvinAguilarPosted about 2 years ago@INS140 You are welcome!π Good luck with your new projects
0
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