Bootstrap 100% height with navbar

后端 未结 3 1862
不思量自难忘°
不思量自难忘° 2020-12-09 02:06

This is basically what I want to achieve:

\"Example\"

I want the total page to be 100% height, but when

3条回答
  •  失恋的感觉
    2020-12-09 03:07

    I change a litle your code by adding a container around your side bar and body class:

    Here is the RESULT

    Css:

    body, html, .container-fluid, .sidebar, .body {
        height: 100%;
        min-height: 100%;
    }
    
    #container{
        width:100%;
        height:100%;
    }
    
    
    .sidebar{
        background-color: green;
        width:10%;
        float:left;
        height:100%;
    
    }
    
    .body{
        background-color: orange;
        float:left;
        width:90%;
        height:100%;
    
    }
    
    .navbar {
        height: 40px;
        position: relative;
        background-color: yellow;
        width:100%;
    }
    

    HTML

    body

提交回复
热议问题