March 16, 2020

How to align lightning-button in Salesforce LWC?

Sample Code:

HTML:

<template>
   
    <div class="slds-clearfix">
        <div class="slds-float_left">
            <lightning-button label="Left" class="slds-m-left_x-small"></lightning-button>
        </div>
    </div>
    <div class="slds-clearfix">
        <div class="slds-align_absolute-center">
            <lightning-button label="Center" class="slds-m-left_x-small"></lightning-button>
        </div>
    </div>
    <div class="slds-clearfix">
        <div class="slds-float_right">
            <lightning-button label="Right" class="slds-m-left_x-small"></lightning-button>
        </div>
    </div>
   
</template>


Output:


No comments:

Post a Comment