一个DIV自适应高度的问题
<div style= "width: 200px; ">
<div id= "aa " style= "background-color: #000; float: left; height: 100%; width: 100px; ">
</div>
<div id= "bb " style= "background-color: #e4e4e4; height: 100%; width: 100px; float: right; "> </div>
</div>
有没有办法让aa里面的内容改变时,bb的高度还是可以和aa一样的高。
aa里可能会放动态改变高度的JS导航菜单之类的
------解决方案--------------------俺可以用 JS 实现!
L@_@K
<div style= "width: 200px; ">
<div id= "aa " style= "background-color: green; float: left; height: 100%; width: 100px; ">
aa <br />
aa1
</div>
<div id= "bb " style= "background-color: #e4e4e4; height: 100%; width: 100px; float: right; "> </div>
</div>
<SCRIPT LANGUAGE= "JavaScript ">
<!--
var oDiv1 = document.getElementById( "aa ");
var oDiv2 = document.getElementById( "bb ");
oDiv2.style.height = oDiv1.offsetHeight;
//-->
</SCRIPT>
------解决方案--------------------参考:http://www.doyoe.com/wzcg/showarticle.asp?keyfid=expbz&id=105