Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  27] [ 6]  / answers: 1 / hits: 26506  / 13 Years ago, thu, march 24, 2011, 12:00:00

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>?


More From » html

 Answers
96

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.


[#93103] Tuesday, March 22, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ronans

Total Points: 460
Total Questions: 109
Total Answers: 108

Location: Slovenia
Member since Sat, Sep 11, 2021
3 Years ago
;