0

I have a web project. I have no trouble when styling html tags, div or class. But when I style a JSF tag (graphicImage) it doesn't work.

It doesn't work neither like this :

graphicImage{
width:280px;
height:130px;
margin-left:10px;}

nor:

h:graphicImage{
width:280px;
height:130px;
margin-left:10px;}

How can I style with external css? Can you please help me?

codergirrl
  • 145
  • 1
  • 11

2 Answers2

2

You DON'T style jsf xhtml tags. You style the client-side html. Take a browser developer tool and inspect the source of what is in the browser. A JSF h:graphicImage client-side side is an <img> tag. Style that.

img {
   width:280px;
   height:130px;
   margin-left:10px;
}

But you can of course use the style and styleClass as well

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
1

Maybe you can do at the tag itself, by using style attribute.

<h:graphicImage style="width:280px;
                height:130px;
                margin-left:10px;"/>

or might be like this.

<h:graphicImage styleClass="testStyle"/>

.testStyle
 {
    width:280px;
    height:130px;
    margin-left:10px;
 }
drs
  • 54
  • 3
  • Sure but that does not explain the error in thinking in the question and hence the reason for the question. Using a (styleClass) is available all over the internet – Kukeltje Apr 20 '18 at 06:37