1<div class="text-center">
2 <button type="button" class="btn btn-primary">My button</button>
3</div>
1<div class="text-center">
2 <button type="button">centered button</button>
3</div>
1 <div class="container my-4">
2
3 <p class="font-weight-bold">You can align the button to the center by simply adding alignment class to the parent div. See the examples.</p>
4
5 <p><strong>Detailed documentation and more examples you can find in our <a href="https://mdbootstrap.com/docs/jquery/utilities/horizontal-align/"
6 target="_blank">Bootstrap Horizontal alignment Docs</a> </p>
7
8 <hr>
9
10 <p class="font-weight-bold">Basic example</p>
11
12 <p>Add class <code>.text-center</code> to the parent div to align <strong>any item</strong> inside to the center.</p>
13
14 <div class="border border-light p-3 mb-4">
15
16 <div class="text-center">
17 <button type="button" class="btn btn-primary">Centered button</button>
18 </div>
19
20 </div>
21
22 </div>