开发者

How can I embed an CSS background image link with JSF?

开发者 https://www.devze.com 2023-03-01 01:46 出处:网络
Is there a way to create the image url dynamically for an embedded style sheet using JSF? Example: <h:head>

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

精彩评论

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