@danielmrz-dev
Posted
Hello, @saini-27Chetan!
Your project is looking fantastic!
I'd like to suggest a way to make it even better:
- Using
margin
isn't always the most effective method for centering an element.
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
or margins
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 helpful
@saini-27Chetan
Posted
@danielmrz-dev Thank you for your help. I will use this in my future projects
@saini-27Chetan
Posted
@danielmrz-dev On giving your style, I am getting a scrollbar, so how to get rid of that? By decreasing the min-height or other?
@danielmrz-dev
Posted
@saini-27Chetan
Your card is bigger than the original design. You need to remove the .container margins and make it a little bit shorter so it fits on the screen without creating a scrollbar. If you keep the margins, they also occupy space on the screen.
Marked as helpful