Right way to center a group of elements #575
-
Hi there, |
Beta Was this translation helpful? Give feedback.
Answered by
claviska
Nov 3, 2021
Replies: 1 comment 3 replies
-
The button group is <div style="text-align: center; border: dashed 2px silver;">
<sl-button-group>
<sl-button type="primary">Left</sl-button>
<sl-button type="primary">Center</sl-button>
<sl-button type="primary">Right</sl-button>
</sl-button-group>
</div> Another approach using flexbox: <div style="display: flex; flex-direction: column; align-items: center; border: dashed 2px silver;">
<sl-button-group>
<sl-button type="primary">Left</sl-button>
<sl-button type="primary">Center</sl-button>
<sl-button type="primary">Right</sl-button>
</sl-button-group>
</div> |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
oliveratgithub
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The button group is
display: inline-block
by default, so this works:Another approach using flexbox: