Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 19, 2020 03:44 am GMT

1 line css to center object

Your search for a way to put an object absolutely in the dead center has finally come to an end because I'm going to show you how to do just that with a single line of css code.

We accomplish this by using the place-items property.

First, make sure to set the display to grid. Then, set the place-items to center as shown below.

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

That's it.


Original Link: https://dev.to/rs9110/1-line-css-to-center-object-i5o

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To