Design comparison
Solution retrospective
I am most proud of the positioning and the sizing of the elements using CSS. What I would do differently next time is work through these decisions quicker since I needed to do a lot of tweaking to get things positioned correctly.
What challenges did you encounter, and how did you overcome them?The main challenge I encountered was getting the paragraph text to wrap the way it does in the preview while keep it exactly aligned with the above text. I ended up making the decision that even though it doesn't look exactly like the mock up, it still looks centered with the right amount of right and left padding.
What specific areas of your project would you like help with?If would be great to get feedback on the accessibility of my HTML. Could I have made better decisions to make things more accessible?
I would also like feedback on the way I approached sizing and positioning in my CSS. Could I have used different units or done things in a more concise and efficient way?
Community feedback
- @kodan96Posted 6 months ago
hi there! ππ
You should avoid hard-coded values (pixels) most of the time. When you use these values you give up responsiveness(or you make it harder for yourself at least)..
Typically you will increase the font-size property with
@media
queries. If you have hard-coded values all over your CSS, you need to modify every element'sfont-size
. On the other hand, if you userem
-s all you need to do is changing thefont-size
in your CSS:root
selector and all your elements will have a new size based on that value.I usually use
em
forpadding and margin
for text-based elements, since their margin usually based on theirfont-size
, and again, when you change the font-size in:root
these values will scale up as well without you touching them, making your job easier and your page maintainable.If you are not familiar with the
:root
selector it's usually used to set custom properties that you can apply later.Hope this helped π
Good luck and happy coding! πͺ
Marked as helpful1@JNeo77Posted 6 months ago@kodan96
Thank you for taking the time to provide that feedback! I will definitely look into the
:root
selector and familiarize myself with it's use.The tip on responsiveness and avoiding hard-coded values is very helpful as well.
Much appreciated!
1 - @danielmrz-devPosted 6 months ago
Hello there!
Congrats on completing the challenge! β
Your project is looking fantastic!
I'd like to suggest a way to make it even better:
- Using
margin
isn't always the most effective method for centering an element.
Here's a highly efficient approach to position an element at the center of the page both vertically and horizontally:
π Apply this CSS to the body (avoid using
position
ormargins
in order to work correctly):body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
I hope you find this helpful!
Keep up the excellent work!
Marked as helpful0@JNeo77Posted 6 months ago@danielmrz-dev
Thanks, Daniel! This is definitely a lot more concise and Flexbox is a great suggestion. I'm not as familiar but will definitely explore how to use it to become more fluent. I will definitely apply this and check out the result. To me it seems a little more intuitive then the way I approached it.
I really appreciate you taking the time to give me feedback!
1 - Using
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