Design comparison
Solution retrospective
Hello,
I'm kinda new to the css game. I've looked at some best practices to start off as clean as possible.
I tried building this projet using the "BEM" methodology as well as the "7-1" Sass project organization.
Feel free to let me know what I did wrong with my classes, variables, folders and files organizations, stuff like that.
On the technical aspect, I struggled sizing the images. I ended up putting them as div's background img instead of <img> but maybe there's a better way of doing it.
Feel free to let me know what you think :)
Cheers, peninoule
Community feedback
- @hyrongennikePosted about 2 years ago
Hi @peninoule,
Congrats on completing the challenge
You can replace your body rule with following one to center the card in the middle of the page.
body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: hsl(30deg, 38%, 92%); line-height: 1; }
1@peninoulePosted about 2 years ago@hyrongennikeThanks for the feedback :)
What's the benefit of using flex instead of grid in that case?
I have the following body rule and it centers quite well the elements with a bit less of code
body { display: grid; place-items: center; min-height: 100vh; background-color: u.$clr-primary-100; line-height: 1; }
0@hyrongennikePosted about 2 years ago@peninoule it's not really center horizontally it's centered but not vertically I also see you have another body rule that has the
min-height: 100vh
which is odd.0@peninoulePosted about 2 years ago@hyrongennike Ah, I see :) I've made the changes
the
min-height: 100vh
is indeed already declared in the css reset that I use.Thank you :)
0@hyrongennikePosted about 2 years ago@peninoule great for simple one dimensional layout or position like menus, alignment etc use flex it's just easier for anything more complex use grid.
1@hyrongennikePosted about 2 years ago@peninoule great for simple one dimensional layout or position like menus, alignment etc use flex it's just easier for anything more complex use grid.
0
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