Sparked
Sparked

Reputation: 874

CSS Overflow Inheritance

This isn't a javascript question but I've created a fiddle so I can demonstrate where I'm stuck (link at bottom).

I would like to apply scrollbars to a child div and overrule the parent.

For instance in the demo, I would like scrollbars to appear alongside the text underneath the header but not extend all the way to the top.

The demo is very basic but the reason I need to do this involves dynamic elements that can be dragged around the screen and can be expanded by the user. The div containing the bulk of the information needs to be scrollable while those above it may be hidden.

Any help would be much appreciated.

LINK TO JSFIDDLE

Upvotes: 0

Views: 2161

Answers (1)

Steve Wellens
Steve Wellens

Reputation: 20620

For overflow to produce scrollbars, you need to give the div a height.

#container{
    overflow:auto;
    height:500px;
};

Upvotes: 4

Related Questions