Expanding the parent container with 100% height to account for floated content

前端 未结 6 986
清酒与你
清酒与你 2020-11-30 21:58

I\'m struggling with a client project. All of my divs have no absolute positioning, height:100% for html, body, and conta

6条回答
  •  我在风中等你
    2020-11-30 22:43

    If height: 100% doesn't work well for you, you can try this calc function from CSS3:

    /* Firefox */
    height: -moz-calc(100%);
    /* WebKit */
    height: -webkit-calc(100%);
    /* Standard */
    height: calc(100%);
    

    You can try this either with height, or with min-height, as already said. You can with this calc functions also other calculations like:

     height: -moz-calc(100% - 50px);
    

    And this is sometimes very useful, as you might guess.

提交回复
热议问题