Is there any work around to do something like this work as expected?
I wish there were something like that width:remainder;
or width:100% - 32px;
.
width: auto;
doesn't works.
I think the only way possible is working around with paddings/margins, negative values, or float, or some html tags hack. I tried also display:block;.
I like to get the same result as this, without tables http://jsfiddle.net/LJGWY/
<div style="position: absolute; width: 100%; height: 100px; border: 3 solid red;" id="container">
<div style="display:inline; width: (100%-100px); border: 3 solid green;">Fill</div>
<div style="display:inline; width: 100px; border: 3 solid blue;">Fixed</div>
</div>
you can use table style. create a div with table style and sub items be that's table-cell styles
label textFor anyone looking over this now theres a newish css property method called calc which can perform this in a much more flexible fashion.
As a word of warning, this is not very portable and support is ropey on mobile devices. IOS 6+ and andriod 4.4 i believe. Support is significantly better for desktop though, IE 9.0+.
http://caniuse.com/calc
I have used a JS hack in the past to achieve this technique if anyone is incredibly stuck, a different layout is more advisable though as resize is slower.