1

I have this css file which sets background image into JSF page:

body { padding: 35px; background: #4c4c4c url(images/grad1.png) 0 0 repeat-x; color: #fff; font: 11px/normal Arial, Helvetica; }

I want to use this tag in order to include the image as JSF resource:

<h:graphicImage library="images" name="grad1.png" />

How I can include the image into the css file as JSF resource?

1 Answer 1

3

Provided that your CSS file is loaded via <h:outputStylesheet>, use #{resource} mapping.

body {
    padding: 35px; 
    background: #4c4c4c url(#{resource['images/grad1.png']}) 0 0 repeat-x; color: #fff; 
    font: 11px/normal Arial, Helvetica;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.