How to fill 100% of remaining height?

后端 未结 8 1058
眼角桃花
眼角桃花 2020-12-04 11:25
+--------------------+
|                    |
|                    |
|                    |
|                    |
|         1          |
|                    |
|            


        
8条回答
  •  Happy的楠姐
    2020-12-04 11:54

        html,
        body {
            height: 100%;
        }
    
        .parent {
            display: flex;
            flex-flow:column;
            height: 100%;
            background: white;
        }
    
        .child-top {
            flex: 0 1 auto;
            background: pink;
        }
    
        .child-bottom {
            flex: 1 1 auto;
            background: green;
        }
        
    This child has just a bit of content
    And this one fills the rest

提交回复
热议问题