CSS 100% height in ie [duplicate]

2019-01-28 02:18发布

问题:

This question already has an answer here:

  • Div 100% height works on Firefox but not in IE 8 answers

Why does height:100% not work in IE. How can we get around this.

回答1:

try

* html .class{ height:100% }


回答2:

You have to set height:100% to all the parents up to body. Try this (it works):

`<html><body style="height:100%;"><div style="height:100%;background-color:red">Here it is!</div></body></html>`