DEV Community

loading...

Discussion on: How to center an element in HTML using CSS Flexbox and CSS grid.

Collapse
colinkiama profile image
Colin Kiama

I don’t know how I was living before learning about flexbox 🤣

Collapse
amaan56 profile image
Amaan Shaikh Author

I used to use margin:auto property but this would only align the item horizontally, for vertical alignment I used to play with margin and padding values until I get the right alignment.