Wrapping bootstrap columns in extra div

前端 未结 1 955
情深已故
情深已故 2020-11-27 23:21

I\'m using bootstrap v4 and when I wrap columns in extra div the layout becomes broken. Why is that? Link to codepen http://codepen.io/mariuszdaniel/pen/aJJjzJ

Works

相关标签:
1条回答
  • 2020-11-27 23:55

    It's happening because col-* must be placed directly inside row.

    Read the Bootstrap docs..

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

    This is especially important in Bootstrap 4 because the columns will simply stack/wrap vertically if not placed directly inside a .row.


    Also read:

    How the Bootstrap Grid Works
    Bootstrap Rows and Columns - Do I need to use row?
    Bootstrap 4.0 Grid System Layout not working

    0 讨论(0)
提交回复
热议问题