Design comparison
Community feedback
- @correlucasPosted about 2 years ago
👾Oi Tiago Silva, tudo bem? Parabéns pelo desafio! Seja bem vindo a comunidade do Frontend Mentor
Acabei de ver sua solução e tenho umas dicas pra melhorar seu código/design:
A sua solução ficou muito boa, a estrutura html o design também, algo que você pode fazer para melhorar a imagem que precisa mudar entre mobile e desktop é usar
<picture>
ao invés de<img>
dentro de uma div. Por motivos de SEO e mecanismos de pesquisa tipo Google e bing, não é uma boa prática importar esta imagem do produto com CSS, pois isso dificultará a localização da imagem no google. Você pode gerenciar ambas as imagens dentro da tag<picture>
e usar o código html para definir quando as imagens devem mudar configurando o dispositivomax-width
dependendo do dispositivo (mobile / desktop) Aqui está um guia sobre como usarpicture
:https://www.w3schools.com/tags/tag_picture.asp
Veja o exemplo abaixo:
<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>
👋 Espero que essas dicas te ajudem e que você continue no foco!
Marked as helpful0 - @VCaramesPosted about 2 years ago
Hey @tascintra, some suggestions to improve you code:
-
The Alt Tag Description for the image needs to be improved upon. You want to describe what the image is; they need to be readable. Assume you’re describing the image to someone.
-
This challenges requires you to use two images for different breakpoints. To properly achieve this, you want to use <picture> element.
Syntax:
<picture> <source media="(min-width: )" srcset=""> <img src="" alt=""> </picture>
Source:
https://www.w3schools.com/html/html_images_picture.asp
https://web.dev/learn/design/picture-element/
-
There is only one heading in this challenge and that is the name of the perfume, “Gabrielle Essence Eau De Parfum”.
-
The old price is not being announced properly to screen readers. You want to wrap it in a Del Element and include a sr-only text explaining that this is the old price.
-
Your CSS Reset is extremely bare and being underutilized. To fully maximize your CSS reset, you want to add more to it.
This is not enough:
* { margin: 0; padding: 0; }
Here are few CSS Resets that you can look at and use to create your own or just copy and paste one that is already prebuilt.
https://www.joshwcomeau.com/css/custom-css-reset/
https://meyerweb.com/eric/tools/css/reset/
http://html5doctor.com/html-5-reset-stylesheet/
Happy Coding!
Marked as helpful0@tascintraPosted about 2 years ago@vcarames thanks for your feedback! I made the changes you purposed and for sr-only text I made a p tag and made it being hide in the layout only for screen readers to read. I tried to use aria-label but there are inconsistance between screen readers to read it. I saw the part about the CSS reset but didn't apply it yet once I have to deliver this project today for my mentor and it would break the layout, but I'm studying about it. Thanks!
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