浮动div高度为百分比解决方案

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<style>

body{ font-size:12px; background-color:#ccc;height:100%;}
.a{ 960px; margin:0px auto; padding-left:10px; padding-right:10px; background:#FFF; height:100%;zoom: 1; overflow:auto;}
.b{ 300px; float:left; height:50%;}
.c{ 650px; float:right; height:400px;}
</style>
<body>
<div class="a">
<div class="b">无标题文档无标题文档无标题文档无标题文档无标题文档无标题文档无标题文档</div>
<div class="c">有标签文档有标签文档有标签文档有标签文档有标签文档有标签文档有标签文档有标签文档有标签文档有标签文档有标签文档有标签文档</div>
</div>
</body>
</html>


<style>
* {
margin: 0;
padding: 0;
}
html{100%;height:100%;}
body{height:100%;zoom: 1; overflow:auto;}
</style>

原文地址:https://www.cnblogs.com/hyp5490-/p/6376825.html