col-*-12 (col-xs / col-sm / etc) use in Bootstrap 3

前端 未结 2 626
面向向阳花
面向向阳花 2020-12-09 04:27

I see something like the following in code examples on StackOverflow and in themes for sale even (never in Bootstrap\'s examples).

2条回答
  •  不知归路
    2020-12-09 05:07

    If something is full width, you don't need it at all.

    enter image description here Learn: http://getbootstrap.com/examples/grid/

    The correct html for both of the above examples is this:

    Words go here

    If you want your columns to be full width, it will be under the last column class you used. The following will be full width below where the col-sm- min-width starts (so 767px and UNDER in a default download of Bootstrap 3.x).

    Stuff
    Stuff

    Don't forget the outer .container or .container-fluid (one per grouping of content that does not change width). The .container or .container-fluid zeros out the negative margin on the .row so you won't get horizontal scroll bars.

    The situations when you use col-*-12 is where you want a full width AFTER the min-width of the smaller column class:

    Stuff
    Stuff

    Anyway, col-*-12 comes in handy in nesting situations, especially with forms.

提交回复
热议问题