页面格局之DIV设置最小高度,并且要有自适应高度
页面布局之DIV设置最小高度,并且要有自适应高度
<style type="text/css">
/*<![CDATA[*/
div {
width:200px;
height:auto!important;
height:200px;
min-height:200px;
border:1px solid green;
}
/*]]>*/
</style>
动态设置DIV高度:
<script> function onLoad(){
var workSpaceW = document.getElementById("body").parentElement.offsetWidth;//宽度
var workSpaceH = document.getElementById("body").parentElement.offsetHeight;//高度
document.getElementById("flowDiv").style.height = workSpaceH-75 ;
}</script>
<body id="body" onload="onLoad()">
<div id="flowDiv" style="width: 150px;; OVERFLOW-X: auto; OVERFLOW: scroll">
dddd</div>
</body>