In my design, I have a parent container with three inner divs that are floated. The left and right divs have fixed sizes, however, I need the center div to expand and fill the space available within the parent container.
<div class="parent-container">
<div class="left"></div>
<div class="center">I want this div to automatically adjust its size to fit the parent container</div>
<div class="right"></div>
<div>
.parent-container
{
overflow: auto;
width: 100%;
border: 1px solid pink;
}
.left { width: 50px; }
.right { width: 80px; }
.left, .center, .right
{
float: left;
border: 1px solid black;
height: 100px;
}
I attempted setting the width to 100%, but it didn't produce the desired result. Does anyone know of a straightforward solution to achieve this layout?