CSS 100 percent height body and element

前端 未结 7 545
野性不改
野性不改 2021-01-02 06:41

I am having an issue making one of my elements 100% within an overall layout that is 100%.

I have tried different positioning solutions and I either end up with hidd

7条回答
  •  孤城傲影
    2021-01-02 07:13

    Answering animuson: actually the following code is necessary for IE6 support:

    min-height: 100%; /* real browsers */
    height: auto !important; /* real browsers */
    height: 100%; /* IE6: treated as min-height*/
    

    IE6 doesn't understand !important, but it does treat height as min-height. So to support both IE6 and modern browser you have to use the exact same code (order is important).

提交回复
热议问题