-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking change in 3.0.1: Nested containers don't properly size #11436
Comments
I'm unable to reproduce that. Test case: http://jsfiddle.net/2cd4j/embedded/result/ |
It happens in your jsfiddle example too but you can't see it because you don't have any visible reference for the outside container. Here is the same example but with a border added to the outside container. http://jsfiddle.net/kMnWc/embedded/result/ Note that on my machine, the browser window size must be 787 or higher to see the overflow. |
Your border depends on padding. I don't see a usage point with |
I think it would be common with sites that use nested master pages (such as ASP.NET MVC sites). I have a couple of ASP.NET MVC sites where the main layout page has a container with a border that surrounds the entire content area of the page. Pages that use that layout page then have containers in them for positioning of content. Here's an example: http://www.cfgrace.com Now that site is still using v3.0.0, but when I change it to v3.0.2 the twitter panel on the right-hand side overflows past the content border at wider page widths. A couple of other sites with similar layouts do the same thing. |
Also, it's not the border. Changing the outside container to remove the border and just use a background color demonstrates the same behavior. |
If I wasn't clear, I think that your box model depends on padding. You are right about container's fixed width, I'm working on a fix. ;) |
hogy lenne közös helyszíneken, hogy a beágyazott mester oldalak (mint például ASP.NET MVC helyek). hogy a gépemen, a böngésző ablak mérete legyen 787 vagy nagyobb, hogy a túlfolyó. |
|
I have this problem too, I change the "width" to "max-width" in the .container and now works fine. example: |
I initially changed width back to max-width, but I ended up just refactoring my site to take out the nested containers. I created my own class called "nested-container" to apply the centering and padding that I was getting from the "container" class. |
It's definitely the fixed width and the padding. Nested containers worked before because of |
See this example for a solution: http://jsbin.com/IhEZadu/1. Definitely need more testing and feedback though to see if this works everywhere—outdenting nested containers might not always make sense. I think for the time being we just don't recommend it. Thoughts from anyone else? |
My recommendation is to avoid nested containers. Fluid containers and rows would fix this (.row -> .container => nesting). :) 2013/12/1 Mark Otto [email protected]
Zlatan Vasović - ZDroid |
At some point, maybe instead of .container it should be called .page-max-width-container or something so people won't nest it. I assumed that .container is for setting the page width and centering it and wouldn't nest it inside another .container. |
@carasmo Yeah, something more specific would be nice come v4. Until then, not much to do since negative margin for the nesting would probably screw up some lives 😆. |
Okay, closing this out since containers have actually never nested "properly" since v3. Here's the lowdown one more time:
We could scope the |
Agree with the conclusion, and as mentioned earlier I ended up refactoring my site to remove the nested containers. However, the DOCS should probably be updated to explicitly state that nested containers aren't supported. |
Reopening as a docs bug. |
The media queries in v3.0.0 set a "max-width" for the ".container" class. This was changed in 3.0.1 to set a "width" instead to support IE 8 which doesn't support "max-width".
This breaks nested ".container" DIVs because the interior ".container" DIVs calculate based on a fixed width instead of the width available in the parent. The net effect is that content overflows on the right.
Example:
The text was updated successfully, but these errors were encountered: