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

How to make outputLabel style the same as standard Salesforce?

Hello.  I have a pageBlockSection with various inputField lines.  I also have one inputText line along with an outputLabel to provide the field label.  However, the label is placed on top of the inputText field, not to the left, and the font color and size do not match the labels of the standard fields.


How do I get the outputLabel to match the standard style?  I've searched the documentation and forums but haven't found anything obvious.



<apex:pageBlockSection title="Contact Details Left Column" columns="1" ShowHeader="False"> <apex:inputField id="contactSalutation" value="{!contact.Salutation}"/> <apex:inputField id="contactFirstName" value="{!contact.FirstName}"/> <apex:inputField id="contactMiddleName" value="{!contact.Middle_Name__c}"/> <apex:inputField id="contactLastName" value="{!contact.LastName}"/> <apex:outputLabel for="accountName" value="Account Name" style="font-weight:bold"/> <apex:inputText id="accountName" value="{!acctName}" title="Account Name"/> <apex:inputField id="contactTitle" value="{!contact.Title}"/> </apex:pageBlockSection>




Best Answer chosen by Admin (Salesforce Developers) 
Thanks gm, that was it.

All Answers

Embed your outputLabel and inputText in a pageBlockSectionItem.
Thanks gm, that was it.
This was selected as the best answer

I am having the same issue.


Can you post the updated code so I can see how you resolved this.



Ok I got.  It looks like this:



<apex:pageBlockSectionItem> <apex:outputLabel value="{!$ObjectType.Case.fields.Status.label}" for="casestatus" style="font-weight:bold"/> <apex:selectList value="{!casestatus}" id="casestatus" size="1" title="Status"> <apex:selectOptions value="{!items}"/> </apex:selectList> </apex:pageBlockSectionItem>