Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I achieve an underlined button on hover with Tailwind CSS?

I'm beginning to learn Tailwind CSS and am trying to implement the button below. It's a blank button that highlights its bottom border on hover.

enter image description here

However, scanning through the docs, I can't seem to be able to recreate the effects.

like image 820
Adam Lau Avatar asked Oct 26 '25 05:10

Adam Lau


1 Answers

<script src="https://cdn.tailwindcss.com"></script>

<div class="flex items-center justify-center min-h-screen">
  <button class="text-6xl font-bold transition duration-150 border-b-8 border-transparent hover:border-purple-500">
    Button
  </button>
</div>
like image 191
ptts Avatar answered Oct 28 '25 19:10

ptts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!