Alternative to "overflow:scroll;" to create a permanent vertical scrollbar in a div?

css, html, scrollbar

Solution

Try to put a wrapper container within the div, and set it to height:101%.

Problem

I have a div in which I need a permanent vertical scrollbar. Sometimes the scrollbar will be needed because the div will contain excess content and other times it will not be needed but I want the appearance to be consistent - even when there is not excess content in the div I want it to contain a scrollbar. I tried this but it doesn't add a scrollbar when there is no excess content: ``` div#collection { margin: 0 0 0 0; padding: 0 0 0 0; border: 0 0 0 0; float: right; width: 200px; height: 100%; background: white; overflow:scroll; } ``` I also tried increasing the height to 200% (html and body are set to 100%) but then the whole page scrolls - which is not what I want - I want the div alone to scroll while the rest of the page remains where it is. Any suggestions?

Original source