The 2 children of my flexbox are each given a style of box-flex: 1
. My understanding is that their widths should then be equal to each other (both occupying 50% of the total width of their parent flexbox). But when content is added to the children, their width changes (depending on what the content is and padding)! Why does this happen?
CSS:
.hasFlex {
display: box;
display: -webkit-box;
display: -moz-box;
-webkit-box-align: start;
-moz-box-align: start;
box-align: start;}
.box0 {
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;}
.box1 {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;}
.box2 {
-webkit-box-flex: 2;
-moz-box-flex: 2;
box-flex: 2;}
.box3 {
-webkit-box-flex: 3;
-moz-box-flex: 3;
box-flex: 3;}
.container {
margin-bottom: 10px;
}
HTML:
<div class="container hasFlex">
<div id="main" role="main" class="box1">
<div class="innerBG">
a bunch of stuff (divs, text, etc) go here
</div>
</div>
<div id="sidebar" class="box1">
<div class="innerBG">
a bunch more stuff (divs, text, etc.) go here
</div>
</div>
</div>