I’ve done this in the past before, I believe using padding. The idea is that I want two elements (div’s) side-by-side (floats) where has a percentage (100%) width and the other has a fixed pixel with (50px).
Poorly draw illustration:
------------------------------------------------
| 100% | 50px |
------------------------------------------------
I don’t want any of the following
- javascript
- less then 100% width like 95% etc wont work
Another answer here: jsfiddle
This is of course, after adding the clearfix solution to the parent div.
This is perhaps not the most semantic way of doing things but it works. If you use this method, I suggest you you add another div in the first div(which has the 100% width) for your content.