How can I stretch a div to 100% page height?

前端 未结 10 1297
一生所求
一生所求 2021-02-06 17:56

    
        

        

    
        
10条回答
  •  旧时难觅i
    2021-02-06 18:38

    html {
        height: 100%;
    }
    

    This will not work if you have a DOCTYPE. I'm looking for an answer too, but I have a DOCTYPE. However, there is a way to do it with a DOCTYPE, but it doesn't work with two divs floating left and right next to eachother, try:

    (div-name) {
        position: absolute;
    }
    

    Be aware that this doesn't look good at all when using two divs floating next to eachother. But, it works fine for any other type.

提交回复
热议问题