Does Bootstrap support fixed width buttons? Currently if I have 2 buttons, "Save" and "Download", the button size changes based on content.
Also what is the right way of extending Bootstrap?
The process for the algorithm would be: get the width of the div, put into a variable. divide the width by the number of buttons and put that answer into a variable. run a function that creates a button at that width by however many times required.
Add an Empty div Element Between Two Buttons to Add Space Between Them in HTML. Use the margin-right Property to Put Space Between the Buttons in HTML.
You can also use the .btn-block
class on the button, so that it expands to the parent's width.
If the parent is a fixed width element the button will expand to take all width. You can apply existing markup to the container to ensure fixed/fluid buttons take up only the required space.
<div class="span2"> <p><button class="btn btn-primary btn-block">Save</button></p> <p><button class="btn btn-success btn-block">Download</button></p> </div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /> <div class="span2"> <p><button class="btn btn-primary btn-block">Save</button></p> <p><button class="btn btn-success btn-block">Download</button></p> </div>
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