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
Yogesh LolgeYogesh Lolge 

Change Pageblock title color and font

I want to add backgroud color and change fot of pageblock title <apex:pageBlock title="Promoter/Group Overview" >
can anyone guide. as its nto accepting div class for formating.
Best Answer chosen by Yogesh Lolge
Malika Pathak 9Malika Pathak 9
Hi Yogesh,
Here's a simple workaround.

Instead of using page block's title, create a facet under pageBlock and name it "header". It'll be auto-assigned as the pageBlock's title when rendered.
 
<apex:pageBlock id="appPageBlock" >
<apex:facet name="header">Promoter/Group Overview</apex:facet>
</apex:pageBlock>

Now use CSS to style it as needed. The title's rendered class name is "pbHeader". So use it like this
.pbHeader{
color:red;
width:10%;
font-size:250%;
}


This should help get you going

if you find this solution is helpful please mark it as the best answer.

All Answers

Malika Pathak 9Malika Pathak 9
Hi Yogesh,
Here's a simple workaround.

Instead of using page block's title, create a facet under pageBlock and name it "header". It'll be auto-assigned as the pageBlock's title when rendered.
 
<apex:pageBlock id="appPageBlock" >
<apex:facet name="header">Promoter/Group Overview</apex:facet>
</apex:pageBlock>

Now use CSS to style it as needed. The title's rendered class name is "pbHeader". So use it like this
.pbHeader{
color:red;
width:10%;
font-size:250%;
}


This should help get you going

if you find this solution is helpful please mark it as the best answer.

This was selected as the best answer
Dushyant SonwarDushyant Sonwar
Yogesh,

You can use the tabstyle attribute apex:page tag. This will give you most appropriate color according to your object and you don't have to manually override your css.
<apex:page tabstyle="objectAPIName" >

Hope this helps!