@correlucas
Posted
👾Hello @CharlesSquirel, Congratulations on completing this challenge!
Your solution its almost done and I’ve some tips to help you to improve it:
1.Your component is perfect, but is not responsive yet, this is due the fixed width
you've applied to the container.Look both width
and max-width
the main difference between these properties is that the first(width) is fixed and the second(max-width) is flexible
, for example, a component with width: 800px
will not grow or shrink because the size will be ever the same, but a container with max-width: 800px
or min-width: 800px
can grow or contract depending of the property you've set for the container. So if you want a responsive block element, never use width
choose or min-width
or max-width
.
2.A better way to work this solution image, the product image is by using <picture>
to wrap it on the html instead of using it as <img>
or background-image
(with the css). Using <picture>
you wrap both images (desktop and mobile) and have more control over it, since you can set in the html when the images changes setting the screen size for each image.ote that for SEO / search engine reasons isn’t a better practice import this product image with CSS since this will make it harder to the image.
Here’s the documentation and the guide to use this tag:
https://www.w3schools.com/tags/tag_picture.asp
See the example below:
<picture>
<source media="(max-width:650px)" srcset="./images/image-product-mobile.jpg">
<img src="./images/image-product-desktop.jpg" alt="Gabrielle Parfum" style="width:auto;">
</picture>
3.Use <main>
instead of a simple <div>
this way you improve the semantics and accessibility showing which is the main block of content on this page. Remember that every page should have a <main>
block and that <div>
doesn't have any semantic meaning.
✌️ I hope this helps you and happy coding!
Marked as helpful