0

I am working in JSF 2.0 application and using external stylesheets for UI styling. But I am unable to change the <h:commandButton> styling through external CSS.

The same was working with in-line styling. Also I am using Richfaces 4.4 skin in my application.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Dev
  • 11
  • 1
  • 4

1 Answers1

0

For applying style in h:commanButton use styleClass attribute:

<h:commandButton value="someName" action="#{bean.method}" styleClass="yourStyle" />

Essential is set CSS after RichFaces styles (for example in template body, not in header):

<h:body>
    <link rel="stylesheet" type="text/css" href="#{properpath}/your.css" media="all" />
</h:body>

In my project it is

<link rel="stylesheet" type="text/css"
    href="#{request.contextPath}/css/basic.css" media="all" />

You can use h:outputStylesheet instead of <link />.

Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40