Sweetalert: button center

Created on 30 May 2018  ·  4Comments  ·  Source: t4t5/sweetalert

How do I make the button centered

Most helpful comment

No need to change the repo's source code. You can simply add the following CSS to your page:

swal-footer {
  text-align: center;
}

You can find more styling options here.

All 4 comments

you can ctrl+f for .swal-footer in the dist/sweetalert.min.js and update the style it's dumping for text-align:right to center. I think this should be committed to the project as the buttons look pretty off to the right.

Thanks for the tip. Works well! I agree that multiple buttons look better when centered. Hopefully someone could add "align" property for button object?

No need to change the repo's source code. You can simply add the following CSS to your page:

swal-footer {
  text-align: center;
}

You can find more styling options here.

Thanks for the link to the themes; should have looked there first!
Just to clarify, the change should be:
.swal-footer {
text-align: center;
}
Works perfectly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vmitchell85 picture vmitchell85  ·  6Comments

mateuszjarzewski picture mateuszjarzewski  ·  4Comments

rafatux picture rafatux  ·  5Comments

krishnamraju picture krishnamraju  ·  3Comments

Untit1ed picture Untit1ed  ·  5Comments