5 Ways To Center Content With CSS
Dhananjay Warade
Posted on March 14, 2022
๐ The Absolutely Absolute way
โ The old & easy way.
๐ The Griddy Way
โ Offers a grid-based layout system.
โ Making it easier to design web pages.
๐ The Flexy Way
โ Easy & Simple.
โ Flexible width/height of elements depending on available space.
๐ The Table Way
โ The very old way when tables were the only real way to structure HTML.
๐ Power of Margins
โ margin: auto on (flex or grid) item will not only horizontally center the element as it did in block layouts, but also center it in the vertical axis.
โจ Hopefully you find something new today!! โจ
โ It was just fun to see that CSS has so many varieties to do the same things just like we have in a programming language.
โ But then it depends on your personal preference & the ๐๐ถ๐๐๐ฎ๐๐ถ๐ผ๐ป when to use each of them.๐คฉโจ
Posted on March 14, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.