Why certain DOCTYPE declarations cause 100%-height tables and divs to stop working?

前端 未结 3 2004
无人及你
无人及你 2020-12-01 23:56

It seems to me that some DOCTYPE declarations in IE (6-8) may cause the browser to ignore height=\"100%\" on tables and divs (style=\"height:

3条回答
  •  我在风中等你
    2020-12-02 00:29

    A real solution to this "problem" would be using the following CSS:

    html, body {
        margin: 0;
        padding: 0;
        border: none;
        height: 100%;
    }
    
    #mydiv {
        height: 100%;
    }
    

    However remember that a border adds height.

提交回复
热议问题