I\'ve got a parent div
floated left, with two child div
s that I need to float right.
The parent div
should (if I understand th
I couldn't come up with a CSS-only solution that fits your requirements, but if you want to use a JavaScript solution, maybe the following code can help? I did not alter the style of the divs, I only added the IDs main
, sub1
, and sub2
to your divs.
var myWidth = document.getElementById('sub1').offsetWidth + document.getElementById('sub2').offsetWidth;
document.getElementById('main').style.width = myWidth;