0

The row as a margin:-15 so it is larget than its container(-fluid).

This is the container This is the row !

Is there a reason for it ? How to cut it out (properly) ?

Hugolpz
  • 17,296
  • 26
  • 100
  • 187

1 Answers1

2

By design, there is a 15px space between 2 columns in bootstrap. And when implementing it, bootstrap's creator uses CSS properties called padding-left and padding-right to set the left and right padding of the column so that the requirement could be full-filled.

Reference: access this link and search for Gutter Width

But there is a problem. The first column only needs padding-right and the last column only needs padding-left.

To solve that problem, bootstrap's creator comes up with a solution in which they sets the left and right margin of the row to be -15px (negative padding is not supported in CSS).

I usually create another CSS class that adjust the padding / margin then append it after the row class.

Cù Đức Hiếu
  • 5,569
  • 4
  • 27
  • 35