Skip to content Skip to sidebar Skip to footer

Container Fix Width. Center Div Dynamic Width. Want Left Right Divs To Fill Out Remaining Width Equally

Have Three columns..Combine width of all three is fixed.. 2nd ( center ) column will have dynamic content.. I need left and right column to fill out remaining space ( container wid

Solution 1:

If you need the left and right columns just for setting the background, then most probably, you don't even need them at all.

Simply setting the background on the .container, giving the same container text-align: center, making the center column inline-block and reseting the background and text-align on it will do the trick.

demo

HTML:

<div class='container'>
    <div class='c'>booooo addremove text here</div>
</div>

CSS:

.container {
    background: #ccc;
    text-align: center;
}
.c {
    display: inline-block;
    background: white;
    text-align: left;
}

Post a Comment for "Container Fix Width. Center Div Dynamic Width. Want Left Right Divs To Fill Out Remaining Width Equally"