Reputation: 913
as we know, the content of a fixed-size div will go out of the div, in case they need more space. ex : http://jsfiddle.net/YaTeG/ now my question is how to stop it without any js ? i mean like an iframe ! which has scrollbars if we need more space.
Upvotes: 1
Views: 284
Reputation: 6279
overflow
property controls both scrollbars horizontal and vertical. If you want further control, you can set the overflow
property separately for each scrollbar.
overflow-x
property controls the horizontal scrollbar and overflow-y
- for the vertical
e.g.
.some_element{
overflow-x: hidden;
overflow-y: auto;
}
Upvotes: 1
Reputation: 15550
If you update your css like this;
#wrapper {
position: absolute;
width: 200px; height: 200px;
top: 20px; left: 20px;
background-color: #ff0;
border: 2px solid #000;
overflow:auto;
}
it will autoscroll authomaticallywhen your content is bigger than div.
overflow:auto;
You can have look at here for different style of this case
Upvotes: 1