if(true) { (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); } if (typeof ga === "function") { ga('create', 'G-EZ0B2QJ2Z6', 'auto', {}); }This one line CSS can centre object easily: Putting end to your Google search | RAHULISM

This one line CSS can centre object easily: Putting end to your Google search

It's hard to centre thing in CSS. Most of the newbie web dev students face the problem and often search every time when on any project. Here is the last and final solution to it. That is centring the object with just one line of CSS code.


The place-items property.
->The place-items property in CSS is shorthand for the align-items and justify-items properties, combining them into a single declaration. These properties have gained use with the introduction of Flexbox and Grid layouts

First, make sure to set the display property to grid and then, set the place-items property to centre.

div {
   display: grid; 
   place-items: center;
}

Ta-Da DONEβœ¨πŸŽ‰πŸŽ‰πŸŽŠ !!!

Thanks For Reading.

I mostly do my project using this only. I hope you will find this helpful as I did. Sorry if it doesn't work with you. (it will work chill βœ¨πŸŽ‰)

Β© 2020 RAHULISM β€’ Developed with ❀️ and πŸ• by RAHUL