Note that there are some explanatory texts on larger screens.

plurals
  1. POResizing and then scrolling browser window and position absolute
    text
    copied!<p>Using the demo html/css below I'm getting a strange problem with the window reszing.</p> <p>Edit: Here's a screen shot:</p> <p><img src="https://i.stack.imgur.com/27c1P.jpg" alt="enter image description here"></p> <ol> <li><p>Resize the window enough so that #mainContent displays scroll bars.</p></li> <li><p>Now use the body's scroll bar (the outter right hand one - not #mainContent's scroll bar!) and scroll to the bottom of the page.</p></li> <li><p>I was hoping that #mainContent would resize and fill the page as we scroll down, but it doesn't, it stays the same size, so I end up with a blank area that is not filled.</p></li> </ol> <p>Is there a css only rememedy to this or do I need some javascript?</p> <p>I've seen this solution on a list a part <a href="http://www.alistapart.com/articles/conflictingabsolutepositions" rel="nofollow noreferrer">this solution on A List Apart</a>. However it hides the body's scroll bar so doesn't really help me.</p> <p>CSS:</p> <pre><code>#sideBar { left: 5px; overflow: auto; position: absolute; right: 5px; top: 0px; width: 235px; border: 1px solid black; height: 5000px; /*silly value just to ensure that scroll bar is visible*/ } #mainContent { position: absolute; right: 5px; top: 0px; bottom: 0px; left: 250px; overflow: auto; padding: 10px; border: 1px solid black; } </code></pre> <p>HTML:</p> <pre> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=utf-8&quot; /&gt; &lt;title&gt;&lt;/title&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;test2.css&quot;/&gt; &lt;/head&gt; &lt;body&gt; &lt;div id=&quot;sideBar&quot;&gt; &lt;ul&gt;&lt;li&gt;Nav&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id=&quot;mainContent&quot;&gt; &lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt;&lt;p&gt;content&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; </pre> <p>Thanks indvance for anyhelp.</p>
 

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