Note that there are some explanatory texts on larger screens.

plurals
  1. POOverflow Scroll css is not working in the div
    primarykey
    data
    text
    <p>I am looking for CSS/Javascript solution for my HTML page scrolling issue.</p> <p>I have three divs that contain a div, a header and a wrapper div, </p> <p>I need a vertical scrollbar in the wrapper div, height should be auto or 100% based on the content.</p> <p>The header should be fixed, and I don't want overall scrollbar so I have given <code>overflow:hidden</code> in the body tag,</p> <p>I need vertical scrollbar in my wrapper div. How can I fix this?</p> <p><strong>HTML</strong></p> <pre><code>&lt;div id="container"&gt; &lt;div class="header"&gt;&lt;/div&gt; &lt;div class="wrapper"&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus porta tortor sed metus. Nam pretium. Sed tempor. Integer ullamcorper, odio quis porttitor sagittis, nisl erat tincidunt massa, eu eleifend eros nibh sollicitudin est. Nulla dignissim. Mauris sollicitudin, arcu id sagittis placerat, tellus mauris egestas felis, eget interdum mi nibh vel lorem. Aliquam egestas hendrerit massa. Suspendisse sed nunc et lacus feugiat hendrerit. Nam cursus euismod augue. Aenean vehicula nisl eu quam luctus adipiscing. Nunc consequat justo pretium orci. Mauris hendrerit fermentum massa. Aenean consectetuer est ut arcu. Aliquam nisl massa, blandit at, accumsan sed, porta vel, metus. Duis fringilla quam ut eros.&lt;/p&gt; &lt;!-- Lots more paragraphs--&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>body{ margin:0; padding:0; overflow:hidden; height:100%} #container { width:1000px; margin:0 auto;} .header { width:1000px; height:30px; background-color:#dadada;} .wrapper{ width:1000px; overflow:scroll; position:relative;} </code></pre> <p>Please refer to this <a href="http://jsfiddle.net/ZcrFr">JS Fiddle</a></p>
    singulars
    1. This table or related slice is empty.
    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.
    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