I am trying to create a form using VF but I am getting old style button so I have tried styleClass attribute but it is not working

Visualforce Code:

<apex:page standardController="Contact" >
    <apex:form > 
        <apex:pageBlock title="Edit Contact">
            <apex:pageBlockSection columns="1">
                <apex:inputField value="{!Contact.FirstName}"/>
                <apex:inputField value="{!Contact.LastName}"/>
                <apex:inputField value="{!Contact.Email}"/>
                <apex:inputField value="{!Contact.Birthdate}"/>
            <apex:pageBlockButtons >
                <apex:commandButton styleClass="slds-button" action="{!save}" value="Save"/>

So can some one help to add new style to button and if possible then any reference link.


1 Answer 1


For this use case Salesforce made available the Lightning Experience Stylesheets. If you change the <apex:page> tag to:

<apex:page standardController="Contact" lightningStylesheets="true">

it should work.


  • It works but now I am not able to see datepicker for Birthday Jul 8, 2019 at 11:47
  • @MysteriousCoder If you have separate follow-up issues, please open a new question, and consider accepting Theodoor's answer if it solved this issue.
    – David Reed
    Jul 8, 2019 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.