我有一个带有多个列和每行一个单选按钮的表格。当我选择特定的按钮时,我需要改变整行的背景颜色。这个能实现吗?
<tr class="flex items-center p-4 space-x-4 border hover:bg-indigo-50">
<input type="radio" name="user" id="{{ user.id }}">
<label for="{{ user.id }}">{{ user.email }}</label>
<div>{{ user.name }}</div>
</tr>
在Tailwind中,可以使用"peer"类来样式化相邻的块。但是我需要样式化父级块(当<input>被选中时,父级块的背景颜色应该改变)。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号