Charles
Charles

Reputation: 1039

Fill space left of a centered fluid max-width div

I have a centered div with fluid width, bound by a max-width:

#content {
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    max-width: 760px;
    width: 80%;
}

I'm having trouble filling the space on the left and right of it due to the max-width property. How do I make also fluid divs to the left and right that will fill the empty space, even when the content div is constrained by the max-width? Preferably in a pure CSS way.

Upvotes: 0

Views: 451

Answers (1)

aroundtheworld
aroundtheworld

Reputation: 782

Use min-width with the 80%? Also perhaps use box-sizing to ensure the percentage values are treated at their true value.

Potential solution here http://jsfiddle.net/vSRgS/1

Upvotes: 0

Related Questions