The reason why it breaks the rows is because you are using the Bootstrap column classes incorrectly. Those are supposed to be used as containers for your content i.e. you are not supposed to add any custom styling (of the kind you did) to your columns because that would lead exactly to the problems you have now.
To solve this, you wrap your column content in divs and then use your custom class giveButton
on those divs. That gives you the freedom to apply any styling you want while still letting Bootstrap do its job when it comes to spacing and responsiveness etc.
To make your buttons span full width I added the native Bootstrap class w-100
(width:100%) to the divs and also added the Bootstrap class text-center
to center things. Done!
Now, the Bootstrap gutters automatically create neat spacing but you can control it further by applying Bootstrap spacing classes to your columns. For example, px-*
with a value between 0 and 5 instead of *
will control the horizontal padding and py-*
will control the vertical padding.
Here's the working code:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<style>
.stripe-button-el
{
visibility: hidden !important;
}
.giveButton {
background: #3D94F6;
background-image: -webkit-linear-gradient(top, #e9e9e9, #f8f8f8);
background-image: -moz-linear-gradient(top, #e9e9e9, #f8f8f8);
background-image: -ms-linear-gradient(top, #e9e9e9, #f8f8f8);
background-image: -o-linear-gradient(top, #e9e9e9, #f8f8f8);
background-image: linear-gradient(to bottom, #e9e9e9, #f8f8f8);
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
color: #747474;
font-family: Open Sans;
font-size: 46px;
font-weight: 100;
padding: 1px;
box-shadow: 1px 1px 7px 0px #000000;
-webkit-box-shadow: 1px 1px 2px 0px #000000;
-moz-box-shadow: 1px 1px 2px 0px #000000;
text-shadow: 3px 0px 5px #d4d4d4;
border: solid #bababa 1px;
text-decoration: none;
display: inline-block;
cursor: pointer;
text-align: center;
font-family: 'Anton', sans-serif;
}
.giveButton span{
top: -15px;
position: relative;
left: -6px;
font-size: 33px;}
.giveButton:hover {
background: #1E62D0;
background-image: -webkit-linear-gradient(top, #0c8955, #71f68f);
background-image: -moz-linear-gradient(top, #0c8955, #71f68f);
background-image: -ms-linear-gradient(top, #0c8955, #71f68f);
background-image: -o-linear-gradient(top, #0c8955, #71f68f);
background-image: linear-gradient(to bottom, #0c8955, #71f68f);
text-decoration: none;
color: white;
}
.SelectedButton
{
background-image: -webkit-linear-gradient(top, #0c8955, #71f68f);
background-image: -moz-linear-gradient(top, #0c8955, #71f68f);
background-image: -ms-linear-gradient(top, #0c8955, #71f68f);
background-image: -o-linear-gradient(top, #0c8955, #71f68f);
background-image: linear-gradient(to bottom, #0c8955, #71f68f);
text-shadow: 3px 0px 5px #7c7c7c;
color: white;
}
</style>
<div class="container">
<div class="row">
<div class="col-4 text-center"><div class="giveButton w-100"><span>$</span>25</div></div>
<div class="col-4 text-center"><div class="giveButton w-100"><span>$</span>50</div></div>
<div class="col-4 text-center"><div class="giveButton w-100"><span>$</span>100</div></div>
</div>
<div class="row">
<div class="col-4 text-center"><div class="giveButton w-100"><span>$</span>250</div></div>
<div class="col-4 text-center"><div class="giveButton w-100"><span>$</span>500</div></div>
<div class="col-4 text-center"><div class="giveButton w-100"><span>$</span>1,000</div></div>
</div>
<div class="row">
<div class="col-12 text-center">
<div class="giveButton w-100"><span>$</span>5,000</div>
</div>
<div class="col-12 text-center">
<div class="giveButton w-100"><span>$</span>10,000</div>
</div>
</div>
</div>