Denver
Denver

Reputation: 45

Fixed div within a div using position:fixed

Could somebody assist me in getting the List items under the listing div to be fixed but scrollable?

<div id="listings">

So that the listing div is the only box being scrolled when the user wishes to scroll down the page. Essentially leaving everything else fixed. I've mocked it up here http://jsfiddle.net/aQpwt/1/

I've been trying to use position:fixed but it hasn't worked as planned. Could someone help?

Upvotes: 0

Views: 46

Answers (1)

Update the CSS class to:

#listings {
    float:right;
    width:790px;
    max-height: 100px;
    overflow:scroll;
}

and remove the leading <br>:

<br class="clear" />

Upvotes: 1

Related Questions