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
Beth G.Beth G. 

Change background color of a visualforce page?

I am trying to change the background color of a visual force page. The code I have is not working.  Please help! How do I fix this?

 

<apex:page standardcontroller="Feature_Request_Form__c" >
<style>
body
{
   background-color: blue; }
   </style>
<apex:form >
<div>To complete the request, click on <b>Submit for Approval</b> button located on the <b>Approval History</b> section of this page.</div>
</apex:form>
</apex:page>
                       
GSBassoGSBasso
<apex:page standardcontroller="Feature_Request_Form__c" >
    <style>
        .myFormStyle {
            background-color: blue;
        }
    </style>
    <apex:form styleClass="myFormStyle">
        <div>To complete the request, click on <b>Submit for Approval</b> button located on the <b>Approval History</b> section of this page.</div>
    </apex:form>
</apex:page>

 

Beth G.Beth G.
Thanks! That was helpful.

Is it possible to change the background color on a VF-page using apex:pageblock? Since it uses Salesforce standard style sheets?



To complete the request, click on Submit for Approval button located on the Approval History section of this page.




________________________________

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
Puja_mfsiPuja_mfsi

Hi,

You need to override the style of standard component.

 

<apex:page>
               <style>
                     .bPageBlock {
                                background-color: red !important;
                     }
               </style>
               <apex:form>
                         <apex:pageblock title="testing">
                                     <div>To complete the request, click on <b>Submit for Approval</b> button located on the <b>Approval                                                    History</b> section of this page.</div>
                         </apex:pageblock>

                </apex:form>

</apex:page>

 

please let me know if you have any problem regarding same,and if this post is helpful please give KUDOS by clicking on star at left.

virenviren

Hi Puja_mfsi,

 

Below code is changing the bacground of form area but if we want to change whole page bacground-color. How it is possible?

<style>
        .myFormStyle {
            background-color: blue;
        }
    </style>

MalgorzataMalgorzata
Hello,

Did you try to set showHeader attribute to "false" ?
For example with the following visualforce page code I manage to display grey page background:

<apex:page  showHeader="false">
      <style>
             body{ background-color:#666362;  }
      </style>
      
</apex:page>

Let me know if helps.
Best Regards,
Malgorzata