Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If I got your question right you are looking for the CSS attribute <code>fixed</code>. Here is some HTML including CSS that might do exactly what your are after:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style&gt; body { margin-top: 150px; } .header { width: 100%; position: fixed; top: 0; background-color: white; border-bottom: 2px solid lightblue } .footer { width: 100%; position: fixed; bottom: 0; background-color: white; border-top: 2px solid lightblue } .book table td { vertical-align: top; } .page1, .page2 { border: solid 1px red; width: 400px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="header"&gt; &lt;h1&gt;Header&lt;/h1&gt; &lt;ul&gt; &lt;li&gt;home&lt;/li&gt; &lt;li&gt;contact us&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="book"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;div class="page1"&gt; &lt;h2&gt;Page1&lt;/h2&gt; scroll from main scrollbar&lt;br/&gt; scroll from main scrollbar&lt;br/&gt; scroll from main scrollbar&lt;br/&gt; ... &lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div class="page2"&gt; &lt;h2&gt;Page2&lt;/h2&gt; scroll from main scrollbar&lt;br/&gt; scroll from main scrollbar&lt;br/&gt; ... &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;div class="footer"&gt; My Footer &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here is a screenshot from my browser showing the above HTML: <img src="https://i.stack.imgur.com/RpgTa.png" alt="enter image description here"></p> <p>The Browser-Scrollbar scrolls only the page1/page2 <code>&lt;div&gt;</code> elemtents but not the header and footer elements.</p> <p>And finally here is the <a href="http://jsfiddle.net/FFKjY/" rel="noreferrer">jsFiddle Link</a> for the online-demo.</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