How can I position my div at the bottom of its container?

前端 未结 24 2966
广开言路
广开言路 2020-11-22 00:46

Given the following HTML:



        
24条回答
  •  感动是毒
    2020-11-22 01:43

    CodePen link here.

    html, body {
        width: 100%;
        height: 100%;
    }
    
    .overlay {
        min-height: 100%;
        position: relative;
    }
    
    .container {
        width: 900px;
        position: relative;
        padding-bottom: 50px;
    }
    
    .height {
        width: 900px;
        height: 50px;
    }
    
    .footer {
        width: 900px;
        height: 50px;
        position: absolute;
        bottom: 0;
    }
    content

提交回复
热议问题