Bootstrap: Responsive container-fluid

Created on 28 Nov 2017  路  7Comments  路  Source: twbs/bootstrap

FEATURE REQUEST: .container-*-fluid

DESCRIPTION: Switch to fluid layout for viewports larger than a certain size.

Use case: https://codepen.io/anon/pen/WXaoyo?editors=1100#0

Implementation for .container-xl-fluid:

@media (min-width: 1200px) {
  .container-xl-fluid {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
    width: 100%;
    max-width: none;
  }
}
css feature v4

Most helpful comment

would love to see this addressed for v4.1.

Common use case is I want a .container for larger devices, and when I go to smaller screen, I want to take advantage of all the real estate available to me and switch to a .container-fluid.

<div class="container-fluid container-md">

    <div>I'm full width on small devices and contained on wider screens.</div>

</div>

All 7 comments

You can basically do this with the existing responsive flex direction utilities

example: https://codepen.io/anon/pen/RjeBMG

Isn't that the same as just normal responsive rows?

https://codepen.io/anon/pen/zPmVGJ

<div class="container-fluid">
  <div class="row">
    <div class="col-xl">
      <p class="alert alert-success">Left</p>
    </div>
    <div class="col-xl">
      <p class="alert alert-primary">Right</p>
    </div>
  </div>
</div>

The problem I am trying to solve is for breakpoints -sm, -md and -lgwith a single column, there are the nice margins that .container has.

screen shot 2017-11-29 at 8 51 32 am
screen shot 2017-11-29 at 8 51 40 am
screen shot 2017-11-29 at 8 51 48 am
screen shot 2017-11-29 at 8 51 56 am
screen shot 2017-11-29 at 8 52 07 am

The columns changing in the CodePen are coincidental to the actual feature request I think. The idea is that we have the ability to toggle from a pixel width to a fluid one with a class. For example:

<div class="container container-md-fluid">
  <div class="row">...<div>
</div>

This would be independent from the normal grid column classes.

@mdo Yes this is correct. Sorry, the rows are totally coincidental.

would love to see this addressed for v4.1.

Common use case is I want a .container for larger devices, and when I go to smaller screen, I want to take advantage of all the real estate available to me and switch to a .container-fluid.

<div class="container-fluid container-md">

    <div>I'm full width on small devices and contained on wider screens.</div>

</div>

Closing since we shipped this in an earlier version with the responsive containers.

Great, thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

knownasilya picture knownasilya  路  3Comments

bellwood picture bellwood  路  3Comments

kamov picture kamov  路  3Comments

steve-32a picture steve-32a  路  3Comments

tiendq picture tiendq  路  3Comments