This will work
overflow-y:auto;
Question
I'm want to add a vertical scrollbar to a section of my webpage if its content grows too big but a grayed-out scrollbar shows up even when the content is small enough to fit. What do I need to change to make the scrollbar show only when its needed?
Example code:
<div id="aaa">
</div>
#aaa {
background-color: #eee;
width: 50px;
height: 100px;
overflow-y: scroll;
}
Result screenshot:
JSFiddle link with live example:
Solution
This will work
overflow-y:auto;
OTHER TIPS
Change the property overflow-y: scroll to overflow-y: auto