<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<style type="text/css">
body,div {margin:0;padding:0}
#MainBody {width:1000px;height:100%;overflow:hidden;margin:0 auto}
.a {width:500px;height:100%;float:left;overflow:hidden;background-color:#000}
.b {width:500px;height:100%;float:right;overflow:hidden;background-color:#F00}
</style>
</head>
<body>
<div id="MainBody">
<div class="a"></div>
<div class="b">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</div>
<script type="text/javascript">
$(function(){
var tarHight = $(".b").height();
$(".a").height(tarHight);
})
</script>
</body>
</html>
记得引入JQ库文件