Design comparison
Community feedback
- @RanitManikPosted 5 months ago
Congratulations on completing the challenge! Here is my feedback for you:
-
Centering the Container: Avoid using
position: absolute
for centering elements. Instead, use a more effective method by applyingmin-height: 100vh;
to thebody
anddisplay: grid; place-items: center;
to center the.container
. This ensures better responsiveness and alignment.body { min-height: 100vh; display: grid; place-items: center; }
-
Unit Choice for Styling
- Opt for using
rem
instead ofpx
orem
for properties like width, height, margin, padding, and font-size. This choice ensures better scalability and responsiveness. Detailed information can be found in this article.
/* Use rem for Better Scalability */ .container { width: 57.4375rem; /* Equivalent to 919px */ height: 31.3125rem; /* Equivalent to 501px */ font-size: 1rem; /* Equivalent to 16px */ }
- Opt for using
If you find this comment helpful please mark it as helpful
Marked as helpful0@VCaramesPosted 5 months ago@RanitManik @sergrosu
For
font-size
, it is best to userem
. Usingem
is rarely necessary forfont-size
; the only time you should useem
is when you need an element'sfont-size
to scale with its parent. Examples of that would beletter-spacing
,buttons/anchors
, etc...More Info:
Marked as helpful0@RanitManikPosted 5 months ago@VCarames I mistakenly wrote "em" there. As you can see, I suggest using "rem" instead of "px" or "em" for properties like width, height, margin, padding, and font-size.
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