Semantic HTML5 markup CSS custom properties Flexbox
Design comparison
Solution retrospective
I think I got this right. Nonetheless, please access it.
Community feedback
- @FluffyKasPosted almost 3 years ago
Hi,
Good job on this one! There's a few things to keep in mind though:
-
It's usually better to avoid using fixed
width
. Instead, you could usemax-
width` (or the combination of the two). Using % to define the width of a component also isn't the best, as it will keep stretching on bigger screens (which isn't something you usually want). You could use px or rem instead. -
I'd get rid of the
height
on the component (you'll rarely ever need to define height). Elements have a natural height, plus you can add padding to increase this. Your component's height should come only from these things. -
Your component won't be centered vertically despite using
align-items
on thebody
if flexbox doesn't have a height to work with: applyingmin-height: 100vh
will do the trick. -
Regarding your HTML, I'd like to share two great videos on the topic: this and this. Both are videos by Kevin Powell about correct structure and using classes instead of IDs, etc. He explains the topic a lot better than I'd do so I suggest watching them, you'd learn some important concepts from him!
-
Your ID names: as mentioned above, you should use classes instead. It would also be helpful to give these classes descriptive names instead of "first" and "second", etc. It helps anyone trying to debug your code to navigate through it and in bigger projects, you'd help yourself too, to find what you're looking for.
-
The "Why Us" section would be better as a
ul
instead of a bunch ofp
tags. -
Button: what I said about setting heights applies here to. Get rid of the height, and try to give it some padding to see what I meant! :)
There's definitely some room for improvement but it's great that you finished a challenge and submitted it ^^ Good luck with learning more and correcting whatever mistakes you made! :)
Marked as helpful0 -
- @denieldenPosted almost 3 years ago
Hi AJAGUN, good job!
Flexbox aligns to the size of the parent container, You can use the
vh
measurement for the CSSheight
property to thebody
... Viewport Height handles the sizing of an element in relation to the height of the browser window.I hope that helps!
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