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

后端 未结 9 545
别跟我提以往
别跟我提以往 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 01:08

    I'm presenting this as a workaround rather than a solution. This may not work all the time. I did it this way as I'm doing a very basic HTML page, for internal use, in a very bizarre environment. I know there are libraries like MaterializeCSS that can do really nice nav bars. (I was going to use them, but it didn't work with my environment.)

    
    

提交回复
热议问题