gpt4 book ai didi

css - 如何为没有背景颜色的表格行着色?

转载 作者:行者123 更新时间:2023-11-28 16:06:44 25 4
gpt4 key购买 nike

是否有任何其他 CSS 属性可用作“background-color”的替代项来设置 的颜色?

我正在使用通过 JavaScript 设置表格元素颜色的第三方工具。我似乎无法使用 CSS 覆盖它,即使使用 !重要。我也无法使用 JavaScript 代码。

所以我想,通过替代方法设置背景颜色可能会奏效。但据我所知,没有任何属性像背景颜色那样起作用。

任何帮助都会很棒。

PS:我更喜欢基于 CSS 的解决方案,而不是任何形式的脚本。

最佳答案

也许这对你有用:

tr {
background-color: red !important; // we want this to override
}
tr {
background-image: linear-gradient(to bottom, blue, blue) !important;
}
tr:hover {
background-image: linear-gradient(to bottom, green, green) !important;
}
<table>
<tr style="background-color: red !important;">
<td>Table Content</td>
</tr>
</table>

关于css - 如何为没有背景颜色的表格行着色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40374727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com