Scroll part of content in fixed position container

后端 未结 5 628
逝去的感伤
逝去的感伤 2020-12-08 00:27

I have a position: fixed div in a layout, as a sidebar. I\'ve been asked to have part of it\'s content stay fixed to the top of it (internally), and the rest to

5条回答
  •  独厮守ぢ
    2020-12-08 00:37

    It seems to work if you use

    div#scrollable {
        overflow-y: scroll;
        height: 100%;
    }
    

    and add padding-bottom: 60px to div.sidebar.

    For example: http://jsfiddle.net/AKL35/6/

    However, I am unsure why it must be 60px.

    Also, you missed the f from overflow-y: scroll;

提交回复
热议问题