4

This is kind of a really nooby question, and I think I already know the answer, but:

Can you add Scrollbars to the side of a <div>?

1
  • 2
    if you add css tag then yes, overflow:scroll Commented Mar 24, 2011 at 4:35

3 Answers 3

8

CSS

div {
   height: 100px;
   overflow: auto;
}

jsFiddle.

You give an explicit height so the div doesn't expand to fit its content.

If you only want horizontal or vertical scrolling, use overflow-x and overflow-y respectively.

If down the track you want the extra content to be hidden, use overflow: hidden.

The default for overflow property is visible.

Sign up to request clarification or add additional context in comments.

Comments

0

Css:

overflow:auto;

or force the scroll area even when content doesn't overflow by:

overflow-y:scroll;

Comments

0

This will add scroll bar in a div

 <div style="overflow:auto; height:556px;width:564px;">
 </div> 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.