@danielmrz-dev
Posted
Hello @alonsovzqz!
Your project looks great!
I have one suggestion for you to improve it even more:
- Using
padding
is not the best option to center an element. Here's a very efficient (and better) way to place an element in the middle of the page both vertically and horizontally:
π Apply this to the body (in order to work properly, don't use position or margins):
body {
min-height: 100vh; /* Use when the whole project fits inside the screen */
display: flex; /* it works with grid too */
justify-content: center;
align-items: center;
}
In this case, due to the length of the element, you might need to use margin
at the top and bottom.
I hope it helps!
Other than that, great job!
Marked as helpful
@alonsovzqz
Posted
@danielmrz-dev Thanks so much! In this case I think I followed the "code" Figma provided so I went for it. But now will try with your solution and from now on I'll just not try to look too much into Figma's code.
And I really appreciate the cheers!