“Height=100%” is not working in html when using <!DOCTYPE>?

前端 未结 3 1038
慢半拍i
慢半拍i 2020-11-30 08:58

When I use HTML without DOCTYPE, my HTML page Height=100% is working.

But when I use DOCTYPE, height is not working correctly.

3条回答
  •  旧时难觅i
    2020-11-30 09:08

    When you state 'height=100%' you have to think "100% of what?". It's the parent of that table element which is the body. But how tall is the body?

    To do what you want, add this in the CSS: html,body{height:100%}

提交回复
热议问题