Given the following:
<div style="display:inline-block">
<lightning-button style="..." class="..." onclick={...} label="..."></lightning-button>
</div>
How can I adjust the width of the Lighting-Button?
I essentially want all my buttons to be the same width for UX purposes.
I have already tried the suggestions in various other posts (using CSS) with no luck.
Best Answer
You can't. The button inside is designed to only be as large as it needs to be. I took a look at the code, and it renders like this:
Where
button-classes
is whatever you put in to the class attribute:Therefore, it seems reasonable that nothing you do will work, short of writing your own custom component. As frustrating as that is, that's the current state of affairs until the component or the related CSS is fixed.