Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Negative left and right margin of .row class in Bootstrap

Just out of curiosity, why bootstrap uses -15px left and right margins which going to cancel the 15px left and right padding on .container and .container-fluid classes.
Why set padding and then cancel it with a negative margin on the child?

like image 819
Omar A Avatar asked Dec 13 '17 05:12

Omar A


1 Answers

A negative margin on row avoids the blank space that would be left because of padding of first column. In its absence the whole layout will look a little indented.

like image 150
pixlboy Avatar answered Sep 19 '22 22:09

pixlboy