我试图在选项卡标题上使用图像/图标而不是文本标题(或可能同时使用它们),我正在测试使用 titleStyleClass 设置图像背景但不起作用
我的素面标签:
<p:tab titleStyleClass="tCliente" title="Vehiculo">
我的css风格
.tCliente
{
background-image: url(../images/logo_tropidatos.gif);
}
感谢您的帮助:D
最佳答案
在 PrimeFaces 3.0 和更新版本上,您可以添加一个方面来覆盖选项卡上的标题:
<p:tabView>
<p:tab>
<!-- overrides title on tab-->
<f:facet name="title">
<h:outputText value="tab title"/>
<p:graphicImage value="/resources/images/icon.png"/>
</f:facet>
<h:panelGrid>
<!-- tab content -->
</h:panelGrid>
</p:tab>
</p:tabView>
希望能帮助到你。
关于image - 将图像或图标添加到 primefaces 选项卡标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8977591/