I have 3 Bootstrap buttons side-by-side, but one of them has a line break (I'm modifying them with white-space: normal
). I need them all to have the same height, and vertical-centered text.
I have them like this:
And I need them like this:
I can't figure out how to do this. Any ideas?
Use the . btn-group-vertical class in Bootstrap to make a button group appear vertically stacked.
Because of its framework, Bootstrap's buttons are already styled when they're added to the site. However, if you want to create your own custom button style, you can do that in Bootstrap's CSS file.
would something like this work for you?
.option-button {
height:100%;
}
.media-object {
height: 100px;
}
<br/><br/>
<div class="media-object pull-left">
<button class="btn btn-info option-button">A</button>
<button class="btn btn-primary option-button">A<br/>B<br/>C</button>
<button class="btn btn-info option-button">A</button>
</div>
<link rel="stylesheet" type="text/css" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
you can use height: 100%;
on the buttons but with that, you need to set the height of the containing div. hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With