I have two floating divs.
I would like the first div to be 100px wide and the other div’s width to be the rest. Something like:
<div style="float:right;width:100px;height:100px;background:black;"></div>
<div style="float:left;width:100%;height:100px;background:yellow;"></div>
Here is jsfiddle.
There is one rule: I don’t know the width of the page!
If you take the
float:left;width:100%;off the second div, it should work the way you want it. When a block is floated to the right, the non-floated objects flow around it. Since you’ve set theheightto be the same for the two blocks, they will line up nicely.I’ve updated your jsfiddle to show how this works.