Activity Forums Salesforce® Discussions How to align pageBlockButtons left or right in a pageBlock?

  • Suyash

    Member
    April 22, 2016 at 6:28 am

    Hello Ravi,

    Apex pageblock buttons and commadbuttons gets its default css styles applied when its rendered. you can use chrome dev tools or firebug to findout the css classes and override them in your vf page.

    Thanks.

  • Ravi

    Member
    April 22, 2016 at 6:37 am

    Thanks, Suyash for your help but i already  tried firebug  to override salesforce css classes but it did not work.

  • Suyash

    Member
    April 22, 2016 at 7:11 am

    Hi Ravi,

    Can you just provide your code for override css because I am able to do it simply in my case. As in my case override it as:

    .listRelatedObject .bPageBlock .pbHeader .btn, .listRelatedObject .bPageBlock .pbBottomButtons .btn, .apexp .bPageBlock .pbHeader .btn, .apexp .bPageBlock .pbBottomButtons .btn, div.buttons .btn, div.pbBottomButtons>.btn {
    margin-left: 197px;
    margin-right: 3px;

    Thanks.

    • This reply was modified 8 years, 7 months ago by  Suyash.
  • Mayuresh

    Member
    February 9, 2017 at 9:11 am

    Use html-align attribute to display the button on right hand side.

    For Example:

    <apex:pageBlockButtons location="bottom" html-align="right">
    <apex:commandButton action="{!saveMyDetails}" value="Save My Details"/>
    </apex:pageBlockButtons>

Log In to reply.

Popular Salesforce Blogs