I need help with my code that is not working as expected. I have a set of images displayed as cards, each with text below them. I am trying to hide the text and only show the image using Tailwind v2, but I can't seem to get it right. Here's my code:
<div class="group max-w-sm bg-white m-4 rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700">
<a href="#">
<img class="rounded-t-lg w-full h-64 object-cover" src="images/care.webp" alt="" />
</a>
<div class="p-1 visible group-hover:invisible">
<p class="visible group-hover:invisible text-center mb-3 font-normal text-gray-700 dark:text-gray-400">CARE</p>
</a>
</div>
</div>
<!-- end of card -->
<!-- Card -->
<div class="group max-w-sm bg-white m-4 rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700">
<a href="#">
<img class="rounded-t-lg w-full h-64 object-cover" src="images/kindness.jpg" alt="" />
</a>
<div class="p-1 invisible group-hover:visible">
<p class="invisible group-hover:visible text-center mb-3 font-normal text-gray-700 dark:text-gray-400">KINDNESS</p>
</a>
</div>
</div>
If you have any advice or recommendations on what I might be doing wrong, please let me know. I've checked the documentation and also looked at some solutions on Stack Overflow with no success.