Design comparison
Solution retrospective
Simply just proud that I went ahead and started this journey. Will be looking into doing more programming instead of watching tutorials all the time.
What challenges did you encounter, and how did you overcome them?A few challenges I came across:
-
Centering an element in the middle of the screen. Overcame this by searching for flexbox tricks.
-
Using a custom font. Never actually looked into this surprisingly and there seem to be several ways of doing this. Read somewhere online that @font-face is the way to go.
All css values have been used with pixels. Would it be possible to use rem instead? From what I learned you preferably want to use em or rem. Using pixel values would only be useful for border width and other small elements.
Why is @font-face the way to go opposed to for example embedding it as a link in the html?
Curious about other possibilities of centering an element in the middle of the page.
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
andmargin
for text-based elements, since their margin usually based on theirfont-size
, and again, when you change thefont-size
in:root
these values will scale up as well without you touching them, making your job easier and your page maintainable.Hope this helps! 🙏
Good luck and happy coding!
Marked as helpful1@DonitronPosted 6 months agoHey @kodan96 !
Thank you so much for your feedback! I made some changes like you suggested. Great learning points :D
1
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