function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MrTikMrTik 

Background image for a page

Hi, All,

 

How can I put an background image on my visualforce page? I have the following code in the page.

 

<apex:stylesheet value="{!$Resource.style00}" />
<body id="tab3">

 

The first line gets the reference to the stylesheet. In the stylesheet I have a body element defined and this is where the image is defined and is not being rendered. Is there a way to make sure that the image is rendered in the background of the page?

 

Really appreciate all the help.

Pradeep_NavatarPradeep_Navatar

Please try this -

 

<apex:page standardStylesheets="false" showHeader="false" >

 

<body style="background-image:url('{!$Resource.backgroundimg}');">

</body>

</apex:page>

 


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

MrTikMrTik

I tried this, however the background does not get reflected. The best solution that I can make to work so far is have the images hosted on publicly accessible web site and access the image in CSS from there. If any one has better / cleaner way to make it work please let me know.

 

Regards.

imuino2imuino2

Make sure that Cache control is set to public on the static resource settings.

And try what Pradeep_Navatar suggested again.

 

Let me know if it works.

 

Ignacio.