Design comparison
SolutionDesign
Solution retrospective
Hello, I'm Vitor this is my solution to this challenge.
Any feedback that can help in cleaner code, for better responsiveness, all tips are always welcome.
Olá, sou Vitor esta é a minha solução para este desafio.
Qualquer feedback sobre como posso melhorar , reduzir o código desnecessário , dicas para ajudar na responsividade é bem-vindo!
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hi there 👋. Good job on completing the challenge ! I have some feedback for you if you want to improve your code.
HTML:
- Use the
<footer>
tag to wrap the footer of the page instead of the<div class="attribution">
. The<footer>
element contains information about the author of the page, the copyright, and other legal information.
- You should use only one
<h1>
tag per page. The<h1>
tag is the most important heading tag, This can confuse screen reader users and search engines. This challenge requires thatSedans
,SUVs
andLuxury
are headings, but you can use the<h2>
tag instead of the<h1>
tag. You can read more about this here.
- Not all images should have alt text. Car icons are for decoration purposes only, so they can be hidden from screen-readers by adding
aria-hidden="true"
and leaving its alt attribute empty:
<img src="assets/images/icon-sedans.svg" alt aria-hidden="true"> <img src="assets/images/icon-suvs.svg" alt aria-hidden="true" > <img src="assets/images/icon-luxury.svg" alt aria-hidden="true" >
- To center the component in the page, you should use Flexbox or Grid layout. You can read more about centering in CSS here. You can read more about centering in CSS here.
body { /* height: 100%; */ min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; } #container { display: flex; max-width: 90rem; /* margin: 0 auto; */ /* margin-top: 8rem; */ margin: 0.5rem; }
- Use
max-width: 40rem;
to#container
selector instead ofwidth: 40rem;
, this will make the container card a bit responsive on mobile and set the element's maximum width to 40rem.
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
Marked as helpful0 - Use the
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