My goal is to have three buttons aligned side by side, but I want them center-aligned instead of floated to the left. I have already set the display to inline-block and vertical align to top.
div.rotateBtn input {
background-image: url("");
margin-left: auto;
margin-right: auto;
background-repeat: no-repeat;
background-size: 75px;
background-position: center;
display: inline-block;
vertical-align: top;
cursor: pointer;
width: 100px;
height: 100px;
border-radius: 50%;
border: 1px;
}
div.randomBtn input {
background-image: url("");
background-repeat: no-repeat;
background-size: 100px;
background-position: center;
display: inline-block;
vertical-align: top;
cursor: pointer;
width: 100px;
height: 100px;
border-radius: 50%;
border: 1px;
}
div.nextBtn input {
background-image: url("");
background-repeat: no-repeat;
background-size: 100px;
background-position: center;
display: inline-block;
vertical-align: top;
cursor: pointer;
width: 100px;
height: 100px;
border-radius: 50%;
border: 1px;
}
.alignme {
width: 1000px;
height: 1000px;
text-align: center;
}
<div class="alignme">
<div class="rotateBtn">
<input type="button" value="" onclick="flipCard()">
</div>
<div class="randomBtn">
<input type="button" value="" onclick="randomiseCard()">
</div>
<div class="nextBtn">
<input type="button" value="" onclick="nextCard()">
</div>
</div>
If you want to see the code in action, check out the fiddle: https://jsfiddle.net/4sgakgck/