question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature request] Auto-switch to .container-fluid on small screens

See original GitHub issue

It would be user-friendly for fixed-width sites (using .container) to be able to switch to .container-fluid when the screen size is sufficiently small. When the size of the screen is similar or smaller than the fixed-width, there’s no need to make the content smaller than the screen’s width anymore. Could something like one of the following be supported?

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

<div class="container-auto-md"></div>

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

Using one of the above would have .container behavior on medium and larger screens and .container-fluid behavior on small and extra-small.

As an example I could find online for demonstration purposes, the Stack Overflow “navbar” switches to fluid when the screen width is smaller than the fixed width. To see this, make your browser window larger than the fixed width, then reduce the width of your browser until it is smaller than the fixed width. https://stackoverflow.com

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
browner12commented, Sep 4, 2018

this will be coming in 4.2 with my responsive containers PR.

https://github.com/twbs/bootstrap/pull/25631

8reactions
browner12commented, Feb 21, 2019

apparently not in 4.2 or 4.3.

If you’re still looking for this functionality, go show so love over on the PR so we can finally get this thing merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap container-fluid on xs devices only - Stack Overflow
I've tried jasnys bootstrap which has a container-smooth class but it doesn't centre the content when the screen gets over a certain size......
Read more >
Containers · Bootstrap v5.0
Containers are a fundamental building block of Bootstrap that contain, pad, and align your content within a given device or viewport.
Read more >
Change to container-fluid on mobile devices - HTML & CSS
Assuming a block element such as div its default width value of auto will already be fluid and fit the full width of...
Read more >
How to create full width container using bootstrap?
We can create full width container using “container-fluid” class of bootstrap. Containers are the most basic layout element in Bootstrap and ...
Read more >
Leveling Up Your App With Advanced Bootstrap Features
Specify a max-width for container-fluid . The value will be the largest size the layout will expand to, once the layout fills this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found