You need to sign in to do that
Don't have an account?
Matthew Allen
pageblocksection colour
Hi,
I am using this very basic code for a VF page. All i want to do is change the colour of the pageblocksection colapsable bars. Can you help?
i have read all sorts of strange ways of doing it, but hoped there was something more straght forward.
I am using this very basic code for a VF page. All i want to do is change the colour of the pageblocksection colapsable bars. Can you help?
i have read all sorts of strange ways of doing it, but hoped there was something more straght forward.
<apex:pageBlockSection title="{!Group_Relationship__c.Group_Name_AP__c} Action Plan" columns="4"> <div style="float:left; width: 100%;" > <apex:pageBlockSection title="Details" columns="4"> <apex:inputField value="{!Group_Relationship__c.Group_Name__c}" required="false"/> </apex:pageBlockSection> </div>
I've Updated Your Code without the Inputfield Components.Kindly check the below Skeleton and add Your Remaining Elements.
<apex:page showHeader="true">
<style>
.custom1 .pbSubheader {
background-color: green !important;
}
.custom2 .pbSubheader {
background-color: red!important;
}
.custom3 .pbSubheader {
background-color: blue!important;
}
.custom4 .pbSubheader {
background-color: black!important;
}
</style>
<apex:pageBlock title="Action Plan">
<apex:tabPanel switchType="client">
<apex:tab label="Details" LabelWidth="200">
<apex:form >
<apex:outputpanel layout="block" styleClass="custom1">
<apex:pageBlockSection title="Page Block Section1 Action Plan" columns="4">
<div style="float:left; width: 100%;" >
<apex:pageBlockSection title="Details" columns="4">
</apex:pageBlockSection>
</div>
</apex:pageBlockSection>
</apex:outputpanel>
<apex:outputpanel layout="block" styleClass="custom2">
<apex:pageBlockSection title="Manheim" columns="4">
<div style="float:left; width: 100%;" >
<apex:pageBlockSection title="Internal" columns="4">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="External" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="Details" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.2%">
<apex:pageBlockSection title="Finance" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 49.5%; margin-right: 5px;">
<apex:pageBlockSection title="Market Share" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 50%">
<apex:pageBlockSection title="Comments" columns="2">
</apex:pageBlockSection>
</div>
</apex:pageBlockSection>
</apex:outputpanel>
<apex:outputpanel layout="block" styleClass="custom3">
<apex:pageBlockSection title="Modix" columns="4">
<div style="float:left; width: 100%;" >
<apex:pageBlockSection title="Internal" columns="4">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="External" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="Details" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.2%">
<apex:pageBlockSection title="Finance" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 49.5%; margin-right: 5px;">
<apex:pageBlockSection title="Market Share" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 50%">
<apex:pageBlockSection title="Comments" columns="2">
</apex:pageBlockSection>
</div>
</apex:pageBlockSection>
</apex:outputpanel>
<apex:outputpanel layout="block" styleClass="custom4">
<apex:pageBlockSection title="Incadea" columns="4">
<div style="float:left; width: 100%;" >
<apex:pageBlockSection title="Internal" columns="4">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="External" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="Details" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.2%">
<apex:pageBlockSection title="Finance" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 49.5%; margin-right: 5px;">
<apex:pageBlockSection title="Market Share" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 50%">
<apex:pageBlockSection title="Comments" columns="2">
</apex:pageBlockSection>
</div>
</apex:pageBlockSection>
</apex:outputpanel>
</apex:form>
</apex:tab>
<apex:tab label="Objectives and Meetings" LabelWidth="200">
</apex:tab>
<apex:tab label="Key Opportunities" LabelWidth="200">
</apex:tab>
<apex:tab label="Key Threats" LabelWidth="200">
</apex:tab>
</apex:tabPanel>
</apex:pageBlock>
</apex:page>
Thanks,
DineshKumar Gopalakrishnan
All Answers
Kindly Check the below Steps it'll help you to Fix that.Let me Know if you face any Issues Regarding this.
1. Right Click on the PageBlockSection Collapsible Bar On UI and Inspect the Particular Element.
2. You can See a Div Element with Some Classes.
3.With the Class name add a Background Css and mention Important Flag.
For Example:
<apex:page >
<apex:form >
<style>
.pbSubheader{
background-color:#000!important;
}
</style>
<apex:pageBlock title="Account">
<apex:pageBlockSection title="PageBlockSection">
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Kindly Mark this as a Best Answer if you Find this Useful!
Thanks
DineshKumar Gopalakrishnan
I have been able to work out how to change all the sections colours, but I can't seem to change them to each be a different colour?
Below is all of my code, I want to change the colours for -
<apex:pageBlockSection title="{!Group_Relationship__c.Group_Name_AP__c} Action Plan" columns="4"> *to be Red
<apex:pageBlockSection title="Manheim" columns="4"> *to be Blue
<apex:pageBlockSection title="Modix" columns="4"> *to be Orange
<apex:pageBlockSection title="Incadea" columns="4"> *to be Green
Wrap your PageBlockSections in to a Apex:OutputPanel Component and add a Style Class for it.It'll work.
Kindly Try the Below Markup
<apex:page >
<style>
.custom1 .pbSubheader{
background-color: red !important;
}
.custom2 .pbSubheader{
background-color: blue !important;
}
.custom3 .pbSubheader {
background-color: green !important;
}
</style>
<apex:pageBlock >
<apex:outputPanel layout="block" styleClass="custom1">
<apex:pageBlockSection title="Section 1">
Content 1
</apex:pageBlockSection>
</apex:outputPanel>
<apex:outputPanel layout="block" styleClass="custom2">
<apex:pageBlockSection title="Section 2">
Content 2
</apex:pageBlockSection>
</apex:outputPanel>
<apex:outputPanel layout="block" styleClass="custom3">
<apex:pageBlockSection title="Section 3">
Content 3
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:page>
Thanks
DineshKumar Gopalakrishnan
I've Updated Your Code without the Inputfield Components.Kindly check the below Skeleton and add Your Remaining Elements.
<apex:page showHeader="true">
<style>
.custom1 .pbSubheader {
background-color: green !important;
}
.custom2 .pbSubheader {
background-color: red!important;
}
.custom3 .pbSubheader {
background-color: blue!important;
}
.custom4 .pbSubheader {
background-color: black!important;
}
</style>
<apex:pageBlock title="Action Plan">
<apex:tabPanel switchType="client">
<apex:tab label="Details" LabelWidth="200">
<apex:form >
<apex:outputpanel layout="block" styleClass="custom1">
<apex:pageBlockSection title="Page Block Section1 Action Plan" columns="4">
<div style="float:left; width: 100%;" >
<apex:pageBlockSection title="Details" columns="4">
</apex:pageBlockSection>
</div>
</apex:pageBlockSection>
</apex:outputpanel>
<apex:outputpanel layout="block" styleClass="custom2">
<apex:pageBlockSection title="Manheim" columns="4">
<div style="float:left; width: 100%;" >
<apex:pageBlockSection title="Internal" columns="4">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="External" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="Details" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.2%">
<apex:pageBlockSection title="Finance" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 49.5%; margin-right: 5px;">
<apex:pageBlockSection title="Market Share" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 50%">
<apex:pageBlockSection title="Comments" columns="2">
</apex:pageBlockSection>
</div>
</apex:pageBlockSection>
</apex:outputpanel>
<apex:outputpanel layout="block" styleClass="custom3">
<apex:pageBlockSection title="Modix" columns="4">
<div style="float:left; width: 100%;" >
<apex:pageBlockSection title="Internal" columns="4">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="External" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="Details" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.2%">
<apex:pageBlockSection title="Finance" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 49.5%; margin-right: 5px;">
<apex:pageBlockSection title="Market Share" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 50%">
<apex:pageBlockSection title="Comments" columns="2">
</apex:pageBlockSection>
</div>
</apex:pageBlockSection>
</apex:outputpanel>
<apex:outputpanel layout="block" styleClass="custom4">
<apex:pageBlockSection title="Incadea" columns="4">
<div style="float:left; width: 100%;" >
<apex:pageBlockSection title="Internal" columns="4">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="External" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.1%; margin-right: 5px;" >
<apex:pageBlockSection title="Details" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 33.2%">
<apex:pageBlockSection title="Finance" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 49.5%; margin-right: 5px;">
<apex:pageBlockSection title="Market Share" columns="2">
</apex:pageBlockSection>
</div>
<div style="float:left; width: 50%">
<apex:pageBlockSection title="Comments" columns="2">
</apex:pageBlockSection>
</div>
</apex:pageBlockSection>
</apex:outputpanel>
</apex:form>
</apex:tab>
<apex:tab label="Objectives and Meetings" LabelWidth="200">
</apex:tab>
<apex:tab label="Key Opportunities" LabelWidth="200">
</apex:tab>
<apex:tab label="Key Threats" LabelWidth="200">
</apex:tab>
</apex:tabPanel>
</apex:pageBlock>
</apex:page>
Thanks,
DineshKumar Gopalakrishnan