...">

How to make a div become a container with a scrollbar?

This is simple code:

<div id="container">            

    <div id = "information">
    </div>

</div>   

When I change the "information" to a width of 1000 and a width of the container of 100, the "information" becomes very long, but I would like to provide the div information inside the div ... I want, I want the container to have a scroll bar if the width of the information is greater, than a container. How can i do this? Thank.

+5
source share
4 answers
#container {
    overflow: auto;
}
+11
source

This should do the trick:

#container
{
    overflow: auto;
}
+6
source

overflow: auto .

, ( AT )

+3

Or use overflow-xand overflow-yto restrict scrolling to vertical or horizontal only.

#container { overflow-x: auto; } /* Horizontal scrolling only */

or

#container { overflow-y: auto; } /* Vertical scrolling only */
+2
source

All Articles