I want to change some style attributes of pageblock header, like padding-bottom or hight.

enter image description here


3 Answers 3


You can apply CSS to Pageblock header like following:

.pbHeader {

   //put your custom css here



I would use an outputPanel with assigned style class as a wrapper for the pageBlock, because we can not assign any style classes directly to thr page block. The access a header. The header has a class mainTitle or you can just access H2 tag directly. Don't forget to use !important notification:

.panelWrapper .mainTitle {
    background-color: green !important;
    color:white !important;
    padding: 30px 0 20px 40px !important;

<apex:outputPanel styleClass="panelWrapper" layout="block">
    <apex:pageBlock title="Hello">

Looks like this then:

enter image description here

  • I used this way but the only applied style is color, but the padding didn't change. maybe because I have custom style for panelWrapper. Thank you Jan 22, 2014 at 10:45

Neither of the above solutions worked for me. But this did.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .