Scroll part of content in fixed position container

后端 未结 5 636
逝去的感伤
逝去的感伤 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:44

    Actually this is better way to do that. If height: 100% is used, the content goes off the border, but when it is 95% everything is in order:

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

提交回复
热议问题