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?
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?
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
).