tailwind css image hover appear text

in this section we will see how to make text appear when hovering over an image in tailwind css.

How to install & setup Tailwind CSS v3

Tool Use

Tailwind CSS 3.v

Pixabay Image

Tailwind CSS Image Hover Show Text

You can use group hover class to create show text on image when hovering.

<!DOCTYPE html>
<html lang="en">

    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Tailwind CSS show text on image when hovering</title>
    <script src="https://cdn.tailwindcss.com"></script>

    <div class="flex items-center justify-center h-screen">
      <a class="relative block w-1/4 bg-gray-900 group" href="#">
        <img class="absolute inset-0 object-cover w-full h-full group-hover:opacity-50"
          src="https://cdn.pixabay.com/photo/2021/10/30/08/07/desert-6753729__340.jpg" alt="" />
        <div class="relative p-2">
          <div class="mt-40">
              class="transition-all transform translate-y-8 opacity-0 group-hover:opacity-100 group-hover:translate-y-0">
              <div class="p-2">
                <p class="text-sm text-white">
                  image hover in text using tailwind css
                <button class="px-4 py-2 text-sm text-white bg-indigo-600">Read More</button>


Read Also

Tailwind CSS 3 FAQ Accordion UI Example

Tailwind CSS 3 Alert Message Example

Tailwind CSS 3 Avatars Example

Tailwind CSS 3 Badges Example

Tailwind CSS 3 Breadcrumb Example

Tailwind CSS Gradient Button Example

Tailwind CSS 3D Button Example

Tailwind CSS Loading Button Example

Tailwind CSS v3 Cards Examples

Tailwind CSS Checkbox Form Examples

Tailwind CSS Dropdowns (Menu) on Hover Example

Tailwind CSS Multiselect Dropdown Example

How to use dark mode toggle switch in Tailwind CSS 3

How to use @apply directive in Tailwind CSS

Tailwind CSS sticky header & fixed navbar example

Tailwind CSS Navbar UI Example

Tailwind CSS 3 Login Page UI Example

Tailwind CSS Login Modal Example

Tailwind CSS Search Examples

Tailwind CSS 3 Overlay Image Example

Tailwind CSS Thank You Page Example

Tailwind CSS Timeline UI Example

Tailwind CSS Responsive Footer Section Example

Tailwind CSS Background Image Header Example