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
michaellee.ampfmichaellee.ampf 

Standard Page Layout Section vs apex:pageBlockSection styling

Hi,

 

We've noticed that there's a difference in the styling between a section on a standard page layout page and an apex:pageBlockSection on a Visualforce page.  Does anyone know if there's a way (probably using CSS) for the apex:pageBlockSection to have the same style as on a standard page layout page?

 

Thanks,

Michael





Best Answer chosen by Admin (Salesforce Developers) 
michaelokeefemichaelokeefe
try adding mode to the pageblock.

<apex:pageBlock mode="maindetail">

All Answers

michaelokeefemichaelokeefe
try adding mode to the pageblock.

<apex:pageBlock mode="maindetail">
This was selected as the best answer
michaellee.ampfmichaellee.ampf

I'm already using mode="inlineEdit", as I want to support inline editing...but that labels it differently.

michaellee.ampfmichaellee.ampf

I was able to fix the problem -- and it was mainly an educational experience on my part.

 

When the pageBlock mode was "inlineEdit", it was not necessary to have an 

<apex:inlineEditSupport  > tag -- but I could switch the mode to "maindetail",  which got the styling that I wanted, and then add 

<apex:inlineEditSupport >  into the body of the pageBlock and everything looked and worked as we wanted it to.

 

 

michaelokeefemichaelokeefe

Great! Glad you got it working.