Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS: four divs, third has to take the rest of the space
    primarykey
    data
    text
    <p>I tried several resources (SO as well) on the internet but I simply can't solve this one.</p> <p>There are just four floated divs on a web page.</p> <ul> <li>divs 1, 2 and 4 have fixed width</li> <li>div 3 has to take up the rest of the width</li> <li>div 2 and 3 have to have a padding in between</li> <li>all divs MUST have padding=0 (requirement for <a href="http://darsa.in/sly/" rel="nofollow">Sly scrolling library</a>)</li> </ul> <p>Here is the schematic diagram of what I'm trying to do in my page:</p> <pre><code> +-----------+--+ +---------------------------+--+ | 1 |2 | | 3 |4 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----------+--+ +---------------------------+--+ </code></pre> <p>No matter what I try, I can't get div 3 to take up rest of the width, while maintaining padding between div 2 and div 3. This was my last attempt:</p> <p>HTML</p> <pre><code>&lt;div id="slyFrame_parent"&gt; P &lt;/div&gt; &lt;div id="slyScrollbar_parent"&gt; S &lt;/div&gt; &lt;div id="slyScrollbar_child"&gt; S &lt;/div&gt; &lt;div id="slyFrame_child"&gt; P &lt;/div&gt; </code></pre> <p>CSS</p> <pre><code>#slyFrame_parent { padding: 0px; float: left; height: 500px; width: 60px; border: 1px solid #333; } div#slyScrollbar_parent { padding: 0px; float: left; height: 500px; width: 16px; border: 1px solid #333; border-left: 0px none; } #slyFrame_child { padding: 0px; overflow: hidden; height: 500px; width: auto; margin-left: 5px; border: 1px solid #333; } div#slyScrollbar_child { padding: 0px; float: right; height: 500px; width: 16px; border: 1px solid #333; border-left: 0px none; } </code></pre> <p>FIDDLE</p> <p><a href="http://jsfiddle.net/ozrentk/jw73j/" rel="nofollow">http://jsfiddle.net/ozrentk/jw73j/</a></p> <p>Is there a solution to it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload