Design comparison
Solution retrospective
all feedbacks are welcome, thank you
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there π. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
HTML π:
- Wrap the page's whole main content in the
<main>
tag.
-
Always avoid skipping heading levels; Starting with <h1> and working your way down the heading levels (<h2>, <h3>, etc.) helps ensure that your document has a clear and consistent hierarchy. Source π.
This challenge requires that
Sedans
,SUVs
andLuxury
are headings, but you can use the<h2>
tag instead of the<h3>
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 leaving its alt attribute empty. You can read more about this here π.
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful0 - Wrap the page's whole main content in the
- @HassiaiPosted almost 2 years ago
Replace <section class="mainbox"> with the main tag, and add <h1> to the content to fix the accessibility issue. click here for more on web-accessibility and semantic html
Give the background-color you gave to .mainbox to the body.
to center .mainbox on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center .mainbox on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center .mainbox on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
in ithe mobile design give .mainbox a max-width value for a responsive content , in the media query you can change the max-width value of .mainbox and give it display: flex.
Replace the height in .suv, .sedan and .luxury with a padding value for all the sides, this will prevent the content from overflowing on smaller screens and its a responsive replacement.
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0
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