【问题标题】:How to set highlight color for p:treeTable如何为 p:treeTable 设置高亮颜色
【发布时间】:2014-10-17 15:17:35
【问题描述】:
有没有办法覆盖 Primefaces 树表突出显示颜色?
无效示例:
tr:hover {
background: #FF0000;
}
.ui-state-hover {
background: #FF0000;
}
.ui-widget-content:hover {
background: #FF0000;
}
.ui-state-highlight {
background: #FF0000;
}
【问题讨论】:
标签:
css
primefaces
treetable
【解决方案1】:
您是否尝试过使用“!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。
【解决方案2】:
我通过以下方式解决了此类问题:
tr.ui-state-highlight .ui-widget-content{
color:white;
}
也许您可以使用 css 类来最小化受影响元素的数量,但不能使用 shure。 =)