How can I embed an CSS background image link with JSF?
Is there a way to create the image url dynamically for an embedded style sheet using JSF?
Example:
<h:head>
<style type="text/css">
.someId { background-image:url(images/example.jpg); }
</style>
</h:head>
(using <h:g开发者_StackOverflow社区raphicImage library="images" name="logo.gif" />
is not supported for embedded CSS).
If I correctly understood your question:
In my project I've used this style:
<h1
class="logo"
style="background:url( #{mainMenuNavigationBean.headerImage} ) no-repeat;">
where mainMenuNavigationBean
is a session bean where I set the headerImage based on some conditions.
精彩评论