首页 > 代码库 > 实现<div>高度最大化的纯css方案

实现<div>高度最大化的纯css方案

<html><head><style type="text/css">html, body {    height: 100%;    margin: 0px;}/* this is the big trick*/#wrapper:before {    content:‘‘;    float: left;    height: 100%;}#wrapper {    height: 100%;    background-color: black;    color: white;}#header {    background-color:#000;}#content {    background-color: grey;}/* this is the big trick*/#content:after {    content:‘‘;    display: block;    clear: both;}</style></head><body><div id="wrapper">    <div id="header">        Title here        </div>    <div id="content">Some content</div></div></body></html>

转自: 

Set div to fill in the rest of the height dynamically?

实现<div>高度最大化的纯css方案