@MelvinAguilar
Posted
Hi there π. Good job on completing the challenge ! I have some feedback for you if you want to improve your code.
The space above the component and not below it is because the entire component is overflowing. You can check this by choosing "overflow: hidden;" in the select "container" and you can see how the component will be centered.
- Setting a defined
height
for the component is not recommended. The content should define the component height, otherwise, it will not be allowed to extend beyond your specifications.
- Setting the width of the component with a percentage or a viewport unit will behave strangely on mobile devices or large screens. You should use a max-width of
920px
to make sure that the component will have a maximum width of920px
on any device, also remove thewidth
property with a percentage value.
HTML:
- 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.
- You should use the
<a>
tag instead of the<button>
tag because theLearn More
button is a link to another page. Use buttons to perform actions like submitting a form or closing a modal and use links to navigate to another page. 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="./images/icon-sedans.svg" alt aria-hidden="true">
<img src="./images/icon-suvs.svg" alt aria-hidden="true" >
<img src="./images/icon-luxury.svg" alt aria-hidden="true" >
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding and Happy New Year! πππ
Marked as helpful
@matthew-marco
Posted
@MelvinAguilar thx so much for your help but why should I remove the precentage width I did that to make the P and the button have a fixed width to get the same shape as in the design pic also I am uploading some changes that You and Hassia Issah told me to do If you wanna see it
@MelvinAguilar
Posted
@matthew-marco Hi! I expressed myself wrong, you should eliminate the width with percentage or vw in the main class="container"
container, because on large screens it looks too big, although there are people who also recommend using the "ch" unit to define a width for text elements like paragraphs.
Marked as helpful
@matthew-marco
Posted
@MelvinAguilar okay i will try that and give you the updates