@danielmrz-dev
Posted
Hello @asmaahamid02!
Your project looks great!
I have one suggestion for you to improve it even more:
- Using
margin
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;
display: flex;
justify-content: center;
align-items: center;
}
I hope it helps!
Other than that, great job!
@asmaahamid02
Posted
@danielmrz-dev Hello Daniel. I really appreciate your help and attention. Actually I didn'r intend to center the div in the middle of the page but I noticed now that it should be centered and modified the code.
You're absolutely right about not using margins for centering but that was not the purpose of margins in my code.
Thanks alot