#{resource['images:xxx.jpg']} cannot work in CSS

Splash Forums SocialPM Users #{resource['images:xxx.jpg']} cannot work in CSS

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Lincoln Baxter III 5 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18086

    xuzhike
    Participant

    Hi, all,

    I use JSF2 to implement a website, found the following css(ui.css) cannot display the image :

    body {

    font: 12px/20px Arial, Verdana, Lucida, Helvetica, simsun, sans-serif;

    background:url(#{resource}) no-repeat;

    // background:url(‘#{request.contextPath}/resources/images/livesino_bg.jpg’) no-repeat; it cannot work too.

    }

    I try to put the image to the folder same as ui.css and in the folder sources/images/. both not work.

    but if the style is in <body> element:

    <h:body style=”background:url(#{resource}) no-repeat;”>

    image display.

    But I found socialpm-web also use the first way (application.css):

    #masthead div.inner,#footer div.inner {

    background: transparent url(#{resource}) top center ;

    padding: 45px 0;

    -webkit-box-shadow: inset 0 10px 30px rgba (0, 0, 0, 0.3 );

    -moz-box-shadow: inset 0 10px 30px rgba (0, 0, 0, 0.3 );

    box-shadow: inset 0 10px 30px rgba (0, 0, 0, 0.3 );

    }

    is it invalid to use #{resource} and #{request.contextPath} in css file?

    or do I miss something?

    thx for your help.

    #21686

    Hi,

    This isn’t really a question about PrettyFaces, but I think you want to use something like this:

    #{resource}

    Also, your images need to be in the webapp/resources/ folder.

    Hope this helps,

    ~Lincoln

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Comments are closed.