0
我正在JSF 2.0
應用程序中使用外部樣式表進行UI樣式設計。但我無法通過外部CSS
更改<h:commandButton>
樣式。如何將樣式應用於jsf 2.0中外部CSS的<h:commandButton>?
這同樣適用於線型造型。另外我在我的應用程序中使用Richfaces 4.4
皮膚。
我正在JSF 2.0
應用程序中使用外部樣式表進行UI樣式設計。但我無法通過外部CSS
更改<h:commandButton>
樣式。如何將樣式應用於jsf 2.0中外部CSS的<h:commandButton>?
這同樣適用於線型造型。另外我在我的應用程序中使用Richfaces 4.4
皮膚。
對於應用樣式在h:commanButton
使用styleClass
屬性:後 RichFaces的樣式(模板身體例如,不在頭)
<h:commandButton value="someName" action="#{bean.method}" styleClass="yourStyle" />
基本設置CSS :
<h:body>
<link rel="stylesheet" type="text/css" href="#{properpath}/your.css" media="all" />
</h:body>
在我項目是
<link rel="stylesheet" type="text/css"
href="#{request.contextPath}/css/basic.css" media="all" />
您可以使用h:outputStylesheet
而不是<link />
。
注意:今天最新穩定的RichFaces版本是4.3.6.Final。你確定使用4.4版嗎? –