Skip to main content

Make center Text for horizontal and vertical in Tailwind Nextjs

Published 1 min readMarkdown

Center Element (use Flex)

<div className="flex justify-center items-center">
<div>Center</div>
</div>

Center Position (use Absolute)

<div className="relative">
<div>
<Icon />
</div>
<div
   className={`absolute top-0 left-0 right-0 bottom-0 text-center content-center`}
>Center</div>
</div>

Center Text (use Text Format)

<span  className={`text-center content-center`}> Center</span>

About the author

  • I am an enthusiastic researcher and developer with a passion for using technology to innovate in business and education.

No comments yet. Be the first to comment.

More from this blog