Reputation: 261
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
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