Ayush Koshta

In most of the interviews you might be asked to center a div, and if you are able to do so, interviewers want to know the different ways you can do it. So here’s a short blog post about centering a div.

Photo by Mika Baumeister on Unsplash

Absolute Positioning of the element

You can position an element absolutely, and use transform property to position it in a center.

--

--

Ayush Koshta

Ayush Koshta

Software developer by profession | Techno Utopian | Amateur Photographer