fylo landing page with two column layout using CSS flex
Design comparison
Solution retrospective
I am proud of my growth and improvement. The learning process in building this is something I appreciate. Next time I would build with best practices in mind. Because I got to know from working on this project that there is more than one way to do something, but the best way is what I should seek out
What challenges did you encounter, and how did you overcome them?I particularly had issues understanding media queries and how they play into a web page's responsiveness. I overcame it by reaching out to other developers in my boot camp for help. There was always someone to explain what could work and what was wrong. By the time I completed this project, I had an above-average understanding of media queries and the way it works.
What specific areas of your project would you like help with?-
When to use width and when to use max-width? What is the major difference? The explanations online are not helping.
-
Is the use of 'em' as a font size unit very important in responsive designs?
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(others call them CSS variables ) that you can apply later.When you apply
width
with pixels you will have a fixed-width element, which also not the best for responsiveness. If you applywidth
with relative units (like %, vh, vw, ch and a bunch of others) your element will be responsive and will change its width based on viewport size. If you combine this withmax-width
you insure that your element won't extend above a certain value:.element-classname { width: 90%; max-width: 60ch; }
in this example the element will take up 90% of the viewport until that value is less than
60ch
, when the element's width reaches this value it won't extend anymore, but it will shrink back down when the viewport size gets small enough.Hope this helped ๐
Good luck and happy coding! ๐ช
Marked as helpful1@funmeelayoPosted 6 months ago@kodan96 Thank you. Your explanation helped a lot.
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