About Bootstrap Grid system

后端 未结 3 1265
花落未央
花落未央 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:17

    Generally, containers as it states, adds padding on left and right so that content doesn't go right to the edge of the screen, making it useable for mobiles and easier to read.

    When using columns, these add padding left and right, which can appear 'out of alignment' against the rest of the content, so you can wrap those in a row, using negative margins to bring that padding back in line with the rest of the content.

    Again, this is to make it appear more aligned and clean.

    From the Bootstrap Documentation (http://getbootstrap.com/css/#grid) :

    Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and padding.

    Use rows to create horizontal groups of columns.

    Content should be placed within columns, and only columns may be immediate children of rows.

提交回复
热议问题