The design of Bootstrap rows includes a margin
(left and right) of -15px
.
This is primarily due to two factors:
- The
.container
has apadding
(left and right) of15px
- The
col-*
classes include a gutter of15px
.
To prevent the empty space caused by the gutter on the first column's left side and the last column's right side, the row is given a margin
(left and right) of -15px
.
A question arises: Why not eliminate the padding
from the container and instead set the padding/margin of a row to 0?
This approach would yield the same result - the first column would be positioned at a distance of 15px
from the .container
, as would the last column.
What could I be overlooking?
I have referenced discussions such as Negative left and right margin of .row class in Bootstrap and Bootstrap's .row margin-left: -15px - why is it outdented (from the docs), but I have yet to identify a justified reason for utilizing negative margins over setting padding to 0.