Friday, 20 January 2017

StyleClass does not work with apex:commandButton Salesforce ?


Below is the code for CSS to change button styles
<apex:page >
        <style type="text/css">
                    .myClass {
                             color:white;
                             background-color:#00CC00;
                     }
         </style>
          <apex:commandButton styleClass="myClass" value="Save" action="{!someAction}">
</apex:page>

If above CSS is not reflecting to your button then change the CSS by adding Important to CSS
like below

<style type="text/css">
        .myClass{
                    color:white !important;
                    background:#00CC00 !important;
         }
</style>
 

1 comment:

Tools for Lightning Web Component Development

 Below are the tools required for Web Component Development 1. Chrome Browser (Prefered) You can download it from Google 2. Visual Studio Co...