About Bootstrap Grid system

后端 未结 3 1269
花落未央
花落未央 2021-01-26 11:44

I\'m confused about this part of code in the source code of bootstrap 3.3.5

/*line 1585 - 1590*/
.container {
  padding-         


        
3条回答
  •  情歌与酒
    2021-01-26 12:43

    Rows should always be placed inside of a container to ensure proper spacing (between page content and the edge of the browser). If you don’t put a row inside a container, the row will be wider than the width of the viewport, causing a horizontal scrollbar.

    The Bootstrap row uses negative margins to counteract the padding of the container. The end result is no visual spacing (margin or padding) on the sides of the row within the container. This is important for responsive designs to ensure even spacing since the columns may wrap or stack vertically (changing the number of columns displayed in each row).

    The same is also true in Bootstrap 4.

    Also see:
    Bootstrap Rows and Columns - Do I need to use row?
    How the Bootstrap grid works

提交回复
热议问题