@M0hamedMagdy
Posted
Don't worry about centering items without flexbox. It's actually recommended to always use flex and grid systems. But you could also use "margin: 0 auto" on the card element with "width: 100% and height: 100vh" on the body and it will be centered.
You can use CSS relative units like "rems" which is relative to the ROOT font-size and then change it using CSS media queries. that will help you make it more responsive on different screens.
Or you can CSS percentages to let the browser do the calculations for you.
I would recommend web.dev "Learn Responsive Design". It will help you a lot
Marked as helpful
@correlucas
Posted
@M0hamedMagdy Nice tips I agree 100%.
@M0hamedMagdy
Posted
@correlucas Thank you <3
@Gaurab019
Posted
@M0hamedMagdy i tried using margin auto but then used a single div with display flex and height as100vh which was easy to use for centering
I have no experience using media query so i did some calculation and put in a fixed width