In this article I saw Bootstrap 4 Spacing Utility Classes, and he uses m-b-lg
in className
.
<div class="row"> <div class="col-sm-6 m-b-lg"> <!-- column-small-50%, margin-bottom-large --> </div> </div>
But when I use it on meteorjs with react nothing happens. Am I missing something or missing a plugin?
<div className="container-fluid"> <div className="col-xs-6 col-xs-offset-3 m-t-lg"> <h1 className="text-xs-center"> Login </h1> <form> <div className="form-group"> <input type="email" className="form-control" id="inputEmail" placeholder="Email"/> </div> <div className="form-group"> <input type="password" className="form-control" id="inputPassword" placeholder="Password"/> <p className="text-xs-center"><a href="/signup"> Forgot your email or password?</a></p> </div> <div className="form-group"> <button className="btn btn-primary btn-block" type="submit"> Login </button> <p className="text-xs-center"> New to Arcademy? <a href="/signup"> Sign up now.</a></p> </div> </form> </div> </div>
If you need to separate rows in bootstrap, you can simply use . form-group . This adds 15px margin to the bottom of row.
r - for classes that set margin-right or padding-right. x - for classes that set both *-left and *-right. y - for classes that set both *-top and *-bottom.
Bootstrap 5 beta - update 2021
Now that Bootstrap 5 has RTL support, the concept of left
and right
have change to start
and end
. Therefore the *l-
and *r-
spacing utilities have changed
pl-*
= ps-*
pr-*
= pe-*
ml-*
= ms-*
pr-*
= me-*
Bootstrap 4 -update 2020
The Bootstrap 4 spacing utils have changed since the original answer (for v4 alpha). Now the syntax is simply:
Examples..
mb-2
= margin bottom 2 spacing unitsm-0
= no marginspt-3
= padding top 3 spacing unitsp-1
= padding all sides 1 spacing unit
There are now 6 sizes (0-5) that represent a portion of the standard .5rem
spacer unit. Additionally, x-axis (left/right) and y-axis (top/bottom) utils have been added:
my-2
= margin top & bottom 2 spacing unitsmx-0
= no margins left & rightpx-3
= padding left & right 3 spacing units
And, the spacing utils are now responsive. The smallest xs
breakpoint is implied when no breakpoint is used.
mt-md-2
= margin top 2 spacing units, on md
(and up)py-sm-0
= no padding top & bottom, on sm
(and up)
Bootstrap 4 Spacing Utils Demo
Related: Bootstrap 4 spacing bug?
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