How can I make the contents of a fixed element scrollable only when it exceeds the height of the viewport?

后端 未结 9 540
别跟我提以往
别跟我提以往 2020-12-01 00:24

I have a div positioned fixed on the left side of a web page, containing menu and navigation links. It has no height set from css, the content dete

9条回答
  •  独厮守ぢ
    2020-12-01 00:58

    Try this on your position:fixed element.

    overflow-y: scroll;
    max-height: 100%;
    

提交回复
热议问题