http://jsfiddle.net/XW9Se/
I\'ve set width: 200px;
on the left
Solved this with a flex not respecting min-width when there was not enough content to fill that width.
Added the CSS rule box-sizing: initial;
on the same flex element that had the non-working min-width declaration.
Add display:inline-block;
in left class
My preferred way of dealing with this situation is to add:
flex-shrink: 0;
This way you may continue using width
in your Flex container and you've given it specific information about how you wish this flex item to behave.
Another option, depending on the requirement is to use min-width
, which is respected when using flex.
add display: contents
on the element or div you want to maintain the width.
Give the #left
div a min-width
of 200px
, should do the job.
Remove the width on .container > div
and use flex: auto; on #main
: fiddle
#main {
flex: auto;
background: lightblue;
-webkit-order: 2;
order: 2;
}