js实现两个div保持相同高度
首先引入jQuery
<div>
<div id="left"style="float:left;width:100px;background:#FF0000;">left</div>
<div id="right"style="float:left;width:100px;background:#666;">right<h1>right</h1></div>
</div>
<script>
$(function(){
if($("#left").height() > $("#right").height()){
$("#right").css("height",$("#left").height())
}else{
$("#left").css("height",$("#right").height())
}
})
</script>