How can I embed a link to a CSS background image with JSF?

Is there a way to create a graphical url dynamically for an inline style sheet using JSF?

Example:

<h:head> <style type="text/css"> .someId { background-image:url(images/example.jpg); } </style> </h:head> 

(using <h:graphicImage library="images" name="logo.gif" /> not supported for inline CSS).

0
source share
1 answer

If I understand your question correctly:

In my project, I used this style:

 <h1 class="logo" style="background:url( #{mainMenuNavigationBean.headerImage} ) no-repeat;"> 

where mainMenuNavigationBean is a bean session where I set headerImage based on some conditions.

+1
source

All Articles