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

前端 未结 6 984
清酒与你
清酒与你 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:52

    height:100% is the height of the content that flows with your container at hand and is not taking into account your floated content, so that is why the height of your container is stopping short. Remove it and clear your container properly to clear your floated elements within and it will work:

    #static-content:before, #static-content:aftr {
     display:table;
     content:"";
    }
    
    #static-content:after {
     clear:both;
    }
    
    #static-content {
     zoom:1; /*ie fix*/
    }
    

提交回复
热议问题