Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Bootstrap 3 force the container width to certain sizes?

If my browser is sized to be 992px wide, then .container has a max-width of 970px. If my browser is sized to be 991px wide, then .container has a max-width of 750px. Why is there this big jump in the max width? Why not just have a max-width of 1170px or so with 20px of margin on each side or something so that as you resize your browser window the container width scales smoothly instead of having a big jump?

E.g. at 992px screen width I have only very little margin on each side (11px). Yet at 991px wide I have 120px of margin on each side, which means nearly 25% of the screen real estate is empty margin on the sides. This doesn't make a lot of sense to me. Is there a reason this was done? Can I remove this behavior of preferring certain container widths without breaking things?

like image 502
Ben McCann Avatar asked Oct 16 '13 00:10

Ben McCann


People also ask

How do I change the width of a container in Bootstrap?

Go to the Customize section on Bootstrap site and choose the size you prefer. You'll have to set @gridColumnWidth and @gridGutterWidth variables. For example: @gridColumnWidth = 65px and @gridGutterWidth = 20px results on a 1000px layout. Then download it.

How do I change the width and height of a container in Bootstrap?

Width and Height Utilities The width and height can be set for an element, by using 25%, 50%, 75%, 100%, and auto values. For instance, use w-25 (for remaining values, replace 25 with those values) for width utility and h-25 (for remaining values, replace 25 with those values) for height utility.

Which Bootstrap class takes full width container?

container-fluid class provides a full width container, spanning the entire width of the viewport.


1 Answers

The official answer from the Bootstrap folks:

What it boils down to is that designing for specific breakpoints is easier (in my mind) than designing for unlimited, unknown sizes. The alternative you mention isn't wrong or bad, just different. I'd rather us maintain the tiers with very specific ranges

like image 59
Ben McCann Avatar answered Oct 03 '22 18:10

Ben McCann