Design comparison
Community feedback
- @correlucasPosted about 2 years ago
πΎHello @ezra-ramatong, congratulations on your first solution!
Nice code and nice solution! You did a good job here putting everything together. Iβve some suggestions for you:
Use
<main>
instead of a simple<div>
this way you improve the semantics and accessibility showing which is the main block of content on this page. Remember that every page should have a<main>
block and that<div>
doesn't have any semantic meaning.Clean your code by removing some unnecessary divs, most of the content can stand alone without a div. Use div only for blocks that need a special alignment or the content needs a special positioning.
The main heading has the tag
<h2>
, in this case, you should replace it with<h1>
since this heading is the main title on this page. Remember that every page should have one<h1>
to declare which is the most important title and that you should follow the hierarchy using the heading sequence(h1, h2, h3, h4, h5)
and never jump a level.To maintain the card responsive use
max-width
instead ofwidth
this way you allow the content to be flexible. The difference betweenmax-width
andwidth
is thatwidth
is fixed andmax-width
has a maximum size but can shrink to fit the content.Use relative units like
rem or em
instead ofpx
to have a better performance when your page content resizes on different screens and devices.REM
andEM
does not just apply to font size, but all sizes as well. To save your time you can code your whole page usingpx
and then in the end use a VsCode plugin calledpx to rem
to do the automatic conversion or use this website https://pixelsconverter.com/px-to-remβοΈ I hope this helps you and happy coding!
Marked as helpful1@ezra-ramatongPosted about 2 years ago@correlucas Hi Lucas, thank you for the helpful feedback. I Implemented your tips and the code is much cleaner. I'm learning about semantic HTML and accessibility now to write better code. I also had some difficulty understanding the difference between width & max-width but now it's clear. Thanks again. π
0 - @denieldenPosted about 2 years ago
Hello Ezra, You have done a good work! π
Some little tips to improve your code:
- add
main
tag and wrap the card for improve the Accessibility - also you can use
article
tag instead of a simplediv
to the container card for improve the Accessibility - use
min-height: 100vh
instead ofheight
, otherwise the content is cut off when the browser height is less than the content - instead of using
px
use relative units of measurement likerem
-> read here
Keep learning how to code with your amazing solutions to challenges.
Hope this help π and Happy coding!
0 - add
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