I'm having an issue with the automatic shrinking of children within a flexible container box. I want the elements with classes .c1
and .c2
to shrink when the page size is reduced, so that their container with class .a2
also shrinks and stays positioned next to .a1
, instead of moving underneath it.
.flexible-container
{
background-color:red;
max-width:500px;
}
.element-a
{
background-color:yellow;
width:100px;
height:100px;
float:left;
display:inline-block;
}
.element-a2
{
background-color:grey;
overflow:auto;
max-width:400px;
width:100%;
}
.element-c
{
background-color:blue;
float:left;
height:60px;
width:50%;
overflow:auto;
}
.element-c2
{
background-color:black;
}
<div class="flexible-container">
<div class="element-a element-a1">aaa</div>
<div class="element-a element-a2">
<div class="element-c element-c1"></div>
<div class="element-c element-c2"></div>
<div style="clear:both"></div>
</div>
<div style="clear:both"></div>
</div>