Real Chembil
Real Chembil

Reputation: 261

Setting the background image for p:panel

I am trying to display a panel with background image using the below code.

    <p:panel id="upperpanel" style="background-image: url(../img/login-bg.jpg)" >

I also tried using

  <p:panel id="upperpanel" style="background-image: url(/user/test/img/login-bg.jpg)" >

In both the cases, I am not getting the background image to be displayed. I also tried using a different image.No Luck. The image is displayed properly when I add a h:graphicImage component inside the panel.

Any help would be appreciated.

Upvotes: 2

Views: 11802

Answers (1)

&#214;mer Faruk Almalı
&#214;mer Faruk Almalı

Reputation: 3822

style="background-image: url('../img/login-bg.jpg');

Is going to work. Also giving !important inside of style property is unnecessary because any css rule that you've defined in style already overrides other css properties with same name. !important can be useful when it is used in a .css file.

Upvotes: 2

Related Questions