You need to sign in to do that
Don't have an account?
DannyK89
Using Style to make a command link look like a command button.
I would like a command like to look like a command button. I was once told that I could to that with using the style but I am having trouble figureing out how to do it. Can anyone give me a hand. Thanks
you can use the styleClass="btn" attribute which will inherit the salesforce buton styles. You might need to use some CSS beyond that to make them an exact match but that should get you 90% of the way there.
All Answers
you can use the styleClass="btn" attribute which will inherit the salesforce buton styles. You might need to use some CSS beyond that to make them an exact match but that should get you 90% of the way there.
That was so useful !
For my piece of code, i wanted to make a normal input type="button" look like a command button and i used:
input type="button" class="btn"
and that seemed to work. Thanks !
Genius! Thanks, this was perfect.
The only additional thing I had to do was add text-decoration:none; to the css style of the link. I did this per link because I didn't want to create a whole class for it, but easily could have.
We wanted a link in an iframe to redirect parent. Code below matched standard button:
<apex:commandLink target="_top" styleClass="btn" style="text-decoration:none;padding:4px;" action="{!URLFOR($Action.MyObject__c.MyNewButton, Id)}" value=" My Custom Button "/>
<apex:commandLink target="_top" styleClass="slds-m-top_xx-small slds-button slds-button_neutral btnSubmit" style="margin:0 auto;" action="{!URLFOR($Action.Acount.View, $CurrentPage.Parameters.Id)}" value="Back"/>