height:100% not working in Internet Explorer

前端 未结 8 1248
别那么骄傲
别那么骄傲 2020-12-03 01:14

I have a question about the CSS property height:100% in Internet Explorer.

height:100% does not work in IE, but it does in Firefox and Chro

8条回答
  •  没有蜡笔的小新
    2020-12-03 02:01

    In IE, in order for an element to have height:100%;, all parent elements must have height:100%;. Any break in the "chain" will cause IE to ignore everything.

    It should work if your css includes the following:

    html,body { height:100%; } 
    #wrapper { height:100%; }
    .section { height:100%; }
    

    I've opened your page in IE and applied these changes using the developers tools and can verify that it works.

提交回复
热议问题