开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜