Can't get angular-material md-sidenav to be 100% height

前端 未结 6 824
后悔当初
后悔当初 2020-12-29 01:37

I\'m making a new angular2 application using angular2-material with a sidenav. And I can\'t for the life of me get that sidenav to have a height of 100%. I\'m trying to ge

6条回答
  •  盖世英雄少女心
    2020-12-29 02:11

      .demo-sidenav-layout {
          position:fixed;
          //border: 3px solid black;
          min-height:100vh;
          md-sidenav {
            padding: 10px;
            background: gainsboro;
            min-height: 100%;
          }
        }
    

    make height 100vh instead of 100%....eventhough you can make width = 100% you cannot simply make height 100% at once ,because usually you can scroll down to infinity. use

    position:absolute;
    

    and then use

    height : 100%;
    

提交回复
热议问题