Design comparison
Solution retrospective
Hi ! I hope my solution is correct. Is the paragraph problematic because there is only two line ? Should I have used a flex box ?
What challenges did you encounter, and how did you overcome them?/
What specific areas of your project would you like help with?/
Community feedback
- @danielmrz-devPosted 7 months ago
Hello, @Demaxs26!
Your project is looking fantastic!
I'd like to suggest a way to make it even better:
- I noticed that your card is not centered, so 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 helpful1@Demaxs26Posted 7 months agohi @danielmrz-dev Thanks for your answer it really help I will try this immediately Can I also use this method ?
.white-box{ transform: translate(-50%, -50%); left: 50%; top: 50%; position : absolute; }
1@danielmrz-devPosted 7 months ago@Demaxs26
You can, but this method can cause bugs and may result in part of the content being cut off on smallers screens depending on the length of the card. It works well only with small elements.
1 - @Zy8712Posted 7 months ago
Hi there! Congrats on finishing your first challenge!
Some things I would suggest you to alter/change:
- instead of using
<h2>
, you should use the<h1>
tag as headings are meant to be used in order from<h1>
to<h6>
without skips. The headings come with default font sizes that can be changed using thefont-size
attribute in css - to center the white card you can do something like this for the parent container which in this case is your
<body>
element:
body{ display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; }
Hope you find this feedback useful š
Marked as helpful1@Demaxs26Posted 7 months agohi @Zy8712 ,
Thanks for your answer ! I will modify that in the code
have a great day !
0 - instead of 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