如何为p:treeTable设置高亮颜色

时间:2014-10-17 15:17:35

标签: css primefaces treetable

有没有办法覆盖Primefaces treetable高亮颜色?

不工作的例子:

tr:hover {
    background: #FF0000;
}
.ui-state-hover {
    background: #FF0000;
}
.ui-widget-content:hover {
    background: #FF0000;
}
.ui-state-highlight {
    background: #FF0000;
}

2 个答案:

答案 0 :(得分:0)

您是否尝试过使用“!important”?

tr:hover {
    background: #FF0000!important;
}
.ui-state-hover {
    background: #FF0000!important;
}
.ui-widget-content:hover {
    background: #FF0000!important;
}
.ui-state-highlight {
    background: #FF0000!important;
}

这将覆盖任何调用相同内容的CSS,例如自动生成的css。

答案 1 :(得分:0)

我用以下方法解决了这类问题:

tr.ui-state-highlight .ui-widget-content{
    color:white;
}

也许你可以使用css-class来减少受影响元素的数量,但不是shure。 =)

相关问题