No margin-bottom on bootstrap button?
Just add the spacing class. m
for margin and p
for padding.
<button class="btn btn-success mr-2" type="submit">Add</button>
<button class="btn btn-danger mr-2" type="button">Delete</button>
so, here mr
is margin-right. similarly, you can add do for other cases.
I think that it's the normal behavior ( not 100% sure ) because it's "cleaner" to add margin ourselves when we want it that having to remove the default margin when we don't want it, from my opinion...
http://getbootstrap.com/components/#btn-groups
There's no margin
on bootstrap's buttons examples, only on the parent div
class btn-group
but it's coming from a different stylesheet ( docs.min.css ). So I think it's that way for devs to add their own custom margin
s.
See here:
In Bootstrap's buttons.less
and button-groups.less
there's nothing about margin-top or margin-bottom. Having a margin by default would likely conflict when combining it with other elements (e.g. a form)
I think the best solution might be adding all buttons inside a btn-toolbar
and to style that combination:
.btn-toolbar .btn {
margin-bottom: 5px;
}
mb-5 = margin bottom
..just add that :) sorted :)