【发布时间】:2021-03-13 19:15:12
【问题描述】:
我一直试图让我的 svg 在悬停时用黑色填充,但似乎无法做到。
这是我希望在悬停时填写的代码。但是,它并不完全奏效。如果我从hover:fill-current 中去掉hover:,那么它只会一直填充黑色。
<svg class="h-6 w-6 text-black hover:fill-current" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
</svg>
有什么想法吗?
【问题讨论】:
标签: html css svg tailwind-css