Fluid Container in Bootstrap 3

前端 未结 5 1152
我寻月下人不归
我寻月下人不归 2020-12-12 21:03

How to make fluid container in bootstrap 3?

In bootstrap 2.3.2 .container-fluid class is there. But now in bootstrap 3 it is missing and there is only <

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 21:45

    The 2.x .container-fluid was replaced by .container in Bootstrap 3.x (http://getbootstrap.com/getting-started/#migration), so the .container is fluid, but it's not full width.

    You can use the row as a fluid container, but you must tweak it a little to avoid a horizontal scroll bar. Excerpt from the docs (http://getbootstrap.com/css/#grid)..

    "Folks looking to create fully fluid layouts (meaning your site stretches the entire width of the viewport) must wrap their grid content in a containing element with padding: 0 15px; to offset the margin: 0 -15px; used on .rows."

    More on changes in 3.x: http://bootply.com/bootstrap-3-migration-guide

    Demo: http://bootply.com/91948

    UPDATE for Bootstrap 3.1

    container-fluid has returned again in Bootstrap 3.1. Now container-fluid can be used to create a full width layout: http://www.bootply.com/116382

提交回复
热议问题