如何更改悬停/突出显示的项目的背景颜色<p:selectOneMenu>
?
我尝试了以下 CSS 选择器,但它们没有任何效果。
.ui-selectonemenu-items :hover{
background-color: #a9c6c9;
}
.ui-selectonemenu-label:hover {
background-color: #a9c6c9;
}
这是JSF代码:
<p:selectOneMenu>
<f:selectItem itemLabel="by id" itemValue="1" />
<f:selectItem itemLabel="by owner" itemValue="2" />
</p:selectOneMenu>
HTML 输出:
<ul class="ui-selectonemenu-items ui-selectonemenu-list ui-widget-content ui-widget ui-corner-all ui-helper-reset" style="">
<li class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all">Select Net</li>
<li class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all ui-state-highlight">TEST</li>
<li class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all">TEST1</li>
<li class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all">TEST2</li>