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

Why doesn't my pageBlockSection style like the standard ones?



I'm using the new styling, eg. Theme3. I'm building a custom editing page for my custom object, and I am using pageBlockSection but the sections look like the old styles (dark solid colors for the title bar, horizontal lines between fields, etc.) I've used the $User.UIThemeDisplayed to prove that "Theme3" is being returned. Am I missing something, or is VisualForce behind on this, or what? I thought the whole idea was my pages would look like the rest of the app.

Thanks for any help,



hey i am facing the same problem dont know how to rectify it.Let me know if you find any solution.


I've discovered this too: when building Visualforce pages to replace standard detail pages, they don't look the same, because the section headers are different. My workaround was to make it from scratch:


<div style="width: 100%; background-color= [your tab color];">[section name]</div>

I guess the answer is, Visualforce is behind. Jeremy

Take a look at the "mode" attribute on pageBlock.


The default user mode for the pageBlock component's child elements. This value determines whether lines are drawn separating field values. Possible values are: "detail", in which data is displayed to the user with colored lines; "maindetail", in which data is displayed to the user with colored lines and a white background, just like the main detail page for records; and "edit", in which data is displayed to the user without field lines. If not specified, this value defaults to "detail". These lines have nothing to do with requiredness, they are merely visual separators, that make it easier to scan a detail page.


If you're using apex:page block, by default it's going to have the gray background and color border. If you want it to look more like the standard, you can add mode="maindetail" to the pageblock tag.



<apex:pageblock mode="maindetail" title="title">


 That will change the layout to the white background and no border...just like the standard layout.


doesnt worked for me:(