height:100% not working in Internet Explorer

前端 未结 8 1243
别那么骄傲
别那么骄傲 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 01:42

    In order to use height: 100%, the parent container should have a fixed height.

    So for example while this should work:

    Left Column
    Right Column

    The following will not work:

    --- same code

    One way to achieve a fixed height when you don't know parent's height is using position: absolute;.

    Left Column
    Right Column

    Otherwise you could use javascript as noted in the other answer. But I prefer pure CSS solutions.

    Check here for a live fiddle.

    Hope that helps.

提交回复
热议问题