1button{
2 /*Change the width as much as you like, but make sure
3 margin-left and margin-right + width = 100%*/
4 width:50%;
5 margin-left:25%;
6 margin-right:25%;
7}
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8" />
5 <title>Button align center</title>
6
7 <style>
8 .flex-parent {
9 display: flex;
10 }
11
12 .jc-center {
13 justify-content: center;
14 }
15
16 button.margin-right {
17 margin-right: 20px;
18 }
19 </style>
20 </head>
21 <body>
22 <div class="flex-parent jc-center">
23 <button type="submit" class="green margin-right">Confirm</button>
24 <button type="submit" class="magenta">Cancel</button>
25 </div>
26 </body>
27</html>