tags:

views:

32

answers:

1

I have two divs

#left, and #right.

the right div has a fixed width.

How can i cause the left div to take up all remaining horizontal space?

A: 

Float the #right div within #left, and leave #left without a float. Add right-padding to #left of the width of #right, if you wish for the space below the floated #right to be empty.

You may also need to add a negative right margin to the #right element equal to the right-padding of left to pull it up to the right edge of #left too. Alternatively to using a negative margin you could set #left with position: relative and add position: absolute to #right to the top left of #left (also with the padding on #left).

pharalia
i did a very similar setup,right is inside left,right is floated rightright has a margin-right of negative its own width,left has a margin-right of #rights, width.
Hailwood
Awesome :) glad to help!
pharalia