How can I make this split that shows three buttons inline responsive (without using bootstrap)?
The problem is that when changing the screen resolution the buttons are not aligned
HTML code:
<div aling="center" style="width:100%;">
<div class="row" aling="center" style="display:inline;text-align:center; margin-left:25%">
<button class="mainForm__total2" type="button" id="startWebCheckout2" tabindex="7"><b>Pagar con Paypal</b></button>
<button class="mainForm__total2" type="button" id="startWebCheckout" tabindex="8"><b>Pagar con otro medio de pago</b></button>
<button class="mainForm__total2" type="button" id="startWebCheckout3" tabindex="9"><b>Pagar con Pse</b></button>
</div>
</div>
CSS:
.mainForm__total2 {
width: auto;
background: #00BEFF;
border: 1px solid #00BEFF;
border-radius: 5px;
color: #fff;
margin: 30px auto;
padding: 10px 20px;
text-align: center;
font-size: 25px;
font-weight: 700;
transition: .3s;
display: inline;
}
.mainForm__total2:hover {
background: #fff;
color: #00BEFF
}
It occurs to me in this edition, as follows:
Part 1
div
the container we give adisplay: flex;
justify-content: space-around;
padding
with the same value for all 4 sides .Part 2
Now to get 2 buttons on the same row and the third one moves to the next one and stays centered, we can do:
flex-wrap
so that when one of the elements of the parent does not enter the same row, then it moves to the nextPart 3
Now for the last arrangement where the 3 buttons will be stacked on top of each other and centered, we can do this:
flex-direction: column;
so that the distribution of the elements is from top to bottomWith an output like this:
Image 1:
Image 2:
Image 3: