CSS How to set div height 100% minus nPx

前端 未结 11 1329
自闭症患者
自闭症患者 2020-12-02 04:17

I have a wrapper div which contans 2 divs next to each other. Above this container I have a div that contains my header. The wrapper div must be 100% minus the height of the

11条回答
  •  醉梦人生
    2020-12-02 04:52

    If you need to support IE6, use JavaScript so manage the size of the wrapper div (set the position of the element in pixels after reading the window size). If you don't want to use JavaScript, then this can't be done. There are workarounds but expect a week or two to make it work in every case and in every browser.

    For other modern browsers, use this css:

    position: absolute;
    top: 60px;
    bottom: 0px;
    

提交回复
热议问题