@Agnik7
Posted
Hi,
Congratulations on completing this challenge!!!🎉🎉🎉
I have some suggestions that will help you a lot.
- Since the picture is changing with screen size, it is better to enclose the img in a
picture
tag. By usingpicture
tag, you won't need to use media query to change the src. For more information on the picture tag, click here.
<picture class="pic">
<source media="(max-width: 375px)" srcset="./images/image-product-mobile.jpg"/>
<img src="./images/image-product-desktop.jpg" alt="Product Image"/>
</picture>
- Instead of defining the font-family for multiple elements individually, it would be better to define it once for all elements.
For example,
span.old-price, span.cart, p, h2{
font-family: 'Montserrat', sans-serif;
}
-
Provide the alt for the icon cart image. Make it a point to always provide the alt text for it tells the browser what to show if image cannot be displayed.
-
Replace the div outside the main tag, by a footer tag. Since, the ending div is supposed to be a footer, enclose it within the landmark tag footer for better accessibility.
Hope this feedback helps you. Have a nice day!!
@lawal2000
Posted
@Agnik7 thanks but when I use the <picture> tag, I was unable to control the image like I wish. Unlike it was when I used the /img tag
@Agnik7
Posted
@lawal2000 You can think of it this way: Inside the picture
tag, you're putting the img
tag only, in order to provide styling to the image, you can just define the style for the img
tag only, and style the picture
tag as and when needed.
Click here to view my solution. From here, I believe you will be able to understand how I am achieving the same result using picture tag.
Have a nice day!!!!
Marked as helpful
@lawal2000
Posted
@Agnik7 Ooh,okay, thanks