How can I make a div 100% of window height?

后端 未结 5 1699
醉酒成梦
醉酒成梦 2020-12-05 10:57

I just want to have a sidebar that will be 100% of window height, but nothing works except this:

#sidebarBack {
background: rgba(20, 20, 20, .3);
position: f         


        
5条回答
  •  悲哀的现实
    2020-12-05 11:31

    Try this -

    html,body{height:100%;}
    #sidebar {
    background: rgba(20, 20, 20, .3);
    /*position: fixed;*/
    width: 100px;
    height: 100%;
    left: 0;
    float:left;
    }
    
    
    section#settings {
    width: 62%;
    height: auto;
    display: inline-block;
    position: relative;
    margin-left: 100px;
    float:left;
    }
    

提交回复
热议问题