tags:

views:

91

answers:

3

I am creating a <div> with a class someClass

.someClass {
   overflow:scroll
   /*other props*/
}

The problem is that the scrollbars are always visible even when the data is not overflowing. I want the scrollbars to be visible only when data actually overflows.

+1  A: 

Use overflow: auto;

Daniel Vassallo
+5  A: 

overflow:auto; should do it. You need to set a width (for horizontal scrolling) and height (vertical) for that to pop out scrollbars at the right time though.

Tor Valamo
A: 

overflow:auto solved my problem

Praveen Prasad