I have the following li item:
<li>
<span style='float:left; background-color:red'>a</span>
<span style='float:left; background-color:green'>b</span>
</li>
I'd like the span on the right to fill whatever width is remaining in its parent li. Is there a way to do that?
Thanks
Looked for the same solution, but found only this which worked great for me:
All you need is just using table-cell displaying and set filler span width to 100%. All other solutions I've tried didn't work for me as expected.
Don't float the second one, and make it
display:block
.http://jsfiddle.net/ymAt5/
You don't want to float each of them left, only the first one, and then make the second one display in block mode: