I have 2 divs side-by-side. The right div has a fixed width. The left div should fill the remaining space even as the window is resized. Example:
+---------------------------------+ +---------------+
| | | |
| divLeft | | divRight |
| <- dynamic width -> | | 120px |
| | | |
+---------------------------------+ +---------------+
<div>
<div id="divLeft">...</div>
<div id="divRight">...</div>
<div>
There's a solution that uses float:right on the right element but it requires reordering the elements like this:
<div>
<div id="divRight" style="float: right; width: 120px;">...</div>
<div id="divLeft">...</div>
<div>
Is there a solution that does not require reordering the elements? I'm in a situation where reordering them will cause other problems. I'd prefer a CSS/HTML solution to this but I am open to using Javascript/JQuery.
Here's a non-working JSFiddle of my attempt to solve it. I'm trying to position the blue div to the right of the green div.