I formatted an output link as a button and now want to resize, but "width" in the css or as inline style does not resize my button to be the same size as the command button used in the same table column:

.TaskBtn{ text-decoration:none;padding:4px; width:100px; }

<apex:commandButton value="New Task" />                                         
<apex:outputLink value="..." target="_blank" styleclass="btn TaskBtn" style="width:100px;">New Sheet</apex:outputLink>

So what to do here? Thanks!


If you want to use <apex:outputLink> then use like this:

I think you could better use <apex:commandLink> which can be shown as button and can call controller method.

<apex:commandButton value="New Task" />                                         
<apex:outputLink value="..." target="_blank" styleclass="btn" 
 New Sheet

<apex:commandLink style="text-decoration:none" action="{!save}">
         <apex:commandButton value="New Task"/>
| improve this answer | |
  • Thanks for the swift answer, but that does not really do the resize of the width either, and I really would like to stick with the outputLink... – user40501 Mar 27 '17 at 6:26

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.