Wrap it in a container that’s h-screen and use flexbox centering:
h-screenmakes the outer div full viewport height.flex items-center justify-centercenters children vertically & horizontally.
asked 404 days ago
1
12
I want a <div> to sit exactly in the center of the page, regardless of screen size. How can I achieve this using TailwindCSS utility classes?
Wrap it in a container that’s h-screen and use flexbox centering:
h-screen makes the outer div full viewport height.flex items-center justify-center centers children vertically & horizontally.1