Jquery 用不同颜色的标签创建一个平面
如何将手风琴的标签设置为各种颜色? 目前,我的CSS文件中有:Jquery 用不同颜色的标签创建一个平面,jquery,primefaces,colors,accordion,Jquery,Primefaces,Colors,Accordion,如何将手风琴的标签设置为各种颜色? 目前,我的CSS文件中有: .ui-accordion .ui-accordion-header a { color: rgb(250,250,250); background: blue; } 编辑: 我更正了我的帖子,因为我忘了说我用素面 我的xhtml文件包含以下内容: <p:accordionPanel multiple="true" > <p:tab title="Blue Tab"> <h
.ui-accordion .ui-accordion-header a {
color: rgb(250,250,250);
background: blue;
}
编辑:
我更正了我的帖子,因为我忘了说我用素面
我的xhtml文件包含以下内容:
<p:accordionPanel multiple="true" >
<p:tab title="Blue Tab">
<h:panelGrid columns="1" cellpadding="10">
<h:outputText
value="This tab must be blue" />
</h:panelGrid>
</p:tab>
<p:tab title="Red Tab">
<h:panelGrid columns="1" cellpadding="10">
<h:outputText
value="This tab must be red" />
</h:panelGrid>
</p:tab>
</p:accordionPanel>
此时,我的两个选项卡都是蓝色的。我怎样才能把第二个变成红色呢?我找到了一个解决办法。我为每个不同颜色的选项卡添加了一个标题样式类:
<p:accordionPanel multiple="true">
<p:tab title="Blue Tab" titleStyleClass="blueTab">
<h:panelGrid columns="1" cellpadding="10">
<h:outputText
value="This tab must be blue" />
</h:panelGrid>
</p:tab>
<p:tab title="Red Tab" titleStyleClass="redTab">
<h:panelGrid columns="1" cellpadding="10">
<h:outputText
value="This tab must be red" />
</h:panelGrid>
</p:tab>
</p:accordionPanel>
它很好用。我希望这能帮助别人
.blueTab {
background: blue;
}
.redTab {
background: red;
}