Design comparison
Solution retrospective
I wrapped everything into a div and used flex inside flex. I
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
<main>
tag to wrap all the main content of the page instead of the<div class="parent">
tag. With this semantic element you can improve the accessibility of your page.
-
You must use a level-one heading (h1) even though this is not a full-page challenge. You can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.:
<h1 class="sr-only">3-column preview card component</h1>
-
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" >
CSS:
- Instead of using pixels in font-size, use relative units like
em
orrem
. The font-size in absolute units like pixels does not scale with the user's browser settings. This can cause accessibility issues for users who have set their browser to use a larger font size. You can read more about this here.
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding and Happy New Year! πππ
Marked as helpful1@vishanthan8055Posted almost 2 years agoHappy new Year!!!
@MelvinAguilar Thanks a lot Melvin....The resources which you shared is really helpful. Thanks again and wish you the same
1 - Use the
- @HassiaiPosted almost 2 years ago
Replace with the main tag to fix the accessibility issue, click here for more on web-accessibility
Reduce the width value of .parent, e.g:
.parent{width: 60rem;}
.There is no need for min-height and height values in .bab increase the padding value of .bab e.g: padding:4rem; there is no need to give .up a width value , min-height value and height value, replace the the height and min-height values with margin bottom value.
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful1@vishanthan8055Posted almost 2 years agoHappy new year @Hassiai
Thanks a lot. These are very helpful in my future upcoming projects
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