@MelvinAguilar
Posted
Hi @Initye ๐, good job on completing this challenge! ๐
Here are some suggestions you might consider:
Regarding your question:
- On mobile devices, you can remove the padding and modify its border radius so that the image covers the entire space.:
@media only screen and (max-width: 375px) {
.img_container {
. . .
/* padding: 1rem; */
padding-bottom: 1rem;
}
.img_container img {
. . .
/* border-radius: 10px; */
border-radius: 10px 10px 0 0;
}
}
Here are some other suggestions:
- Instead of using pixels in font size, use relative units of measure like
rem
orem
. The font size in absolute length units (px) does not allow users with limited vision to change the text size in some browsers. Reference. - You can use a <picture> tag when you need to change an image in different viewports. Using this tag will prevent the browser from loading both images, saving bandwidth and preventing you from utilizing a media query to modify the image.
Example:
<picture>
<source media="(max-width: 375px)" srcset="./image-product-mobile.jpg">
<img src="./image-product-desktop.jpg" alt="your_alt_text">
</picture>
- You could use the <del> tag to display the old price:
<del class="old-price">$169.99</del>
- The cart icon is for decoration purposes only, so it can be hidden from screen-readers by adding
aria-hidden="true"
and leaving its alt attribute empty:
<img src="icon-cart.svg" alt aria-hidden="true">
I hope those tips will help you.
Good job, and happy coding!
Marked as helpful