CSS How to set div height 100% minus nPx

前端 未结 11 1328
自闭症患者
自闭症患者 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:57

    div {
        height: 100%;
        height: -webkit-calc(100% - 60px);
        height: -moz-calc(100% - 60px);
        height: calc(100% - 60px);
    }
    

    Make sure while using less

    height: ~calc(100% - 60px);
    

    Otherwise less is no going to compile it correctly

提交回复
热议问题