I found a lot of similar questions and tried out several solutions (including some of the so-called CSS “Holy Grail” layouts), but they don’t quite do what I need.
I have a containing div (block containing CSS) with id right . Inside this on the left, I want a div with a fixed width (a separator, but no matter what it is used for: id splitpane ); on the right, filling the rest of the space with another div (id right-box below).
I tried to make two internal divs display: inline-block (with vertical-align: top ), setting the left to width: 3px , but then there is no way to set the right to 100% - 3px wide. I also tried using the float: left / margin-left: -100% / margin-left: 3px , but it has the same problem: 100% plus 3px overflows the parent block and causes the scrollbar to appear. (Of course, this is not a scroll bar per se, I could use overflow: hidden to remove it, but then the content on the right will be truncated.)
I am currently using width: 99.5% for the right div, but it is a terrible hack (and prone to overflow depending on screen width). It looks something like this:
<div id="right"><div id="splitpane"></div><div id="right-box"> ... </div></div>
With CSS as follows (floating point version, but the inline block version is similar):
#right { display: inline-block; vertical-align: top; height: 100%; width: 85%; } #right-box { width: 99.5%; height: 100%; } #splitpane { float: left; width: 3px; height: 100%; background: white; border-left: solid gray 1px; border-right: solid gray 1px; cursor: e-resize; }
Is it possible to do this? This is for an internal application. Therefore, solutions should work only in Firefox 3 (if they are specific to FF3, although it is desirable because the solution is compatible with the standards, but there are no other browsers, and not because it uses only Firefox code).
source share