首页  >  问答  >  正文

使用 CSS Tailwind 的图像悬停卡动画未按预期运行。

<html>

<body>
  <div class="group card my-14 mx-3 w-80 h-100 bg-gray-800 rounded-xl text-white p-5 cursor-pointer">
    <div class=" flex justify-between items-center text-2xl ">
      <i class='bx bx-heart'></i>
      <i class='bx bx-cart-alt'></i>
    </div>
    <div class="w-11/12 ml-2.5 group-hover:text-white group-hover:-rotate-20">
      <img class="object-cover w-full h-full" src="./Images/Jordan.png" id="bannerImage" alt="">
    </div>
    <div class="text-center uppercase text-xl text-green-600">
      Jordan 1 <br>
      9
    </div>

  </div>
</body>

</html>

解释为什么基于父状态的样式不起作用。 ......................................

P粉863295057P粉863295057166 天前351

全部回复(1)我来回复

  • P粉238433862

    P粉2384338622024-04-07 12:19:22

    Tailwind 没有 -rotate-20 实用程序。将其更改为已知之一或使用 任意 值,例如 group-hover:-rotate- [20deg]

    回复
    0
  • 取消回复