这里我们定义了boxout与boxinside两个class,我现在要做的就是让boxout高度去自动适应boxInside的高度变化,好了现在我们来定义css代码
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>css 高度自适应代码与自适应高度css兼容ie,firefox</title>
</head>
<style type="text/css">
.boxOut{
height:100%;
width:200px;
border:1px solid #990000;
float:left;
overflow:hidden;
}
.boxInside{
height:500px;
width:100px;
background:#0000CC;
}
</style>
<body>
<!-- -->
<div class="boxOut">
<div class="boxInside">
</div>
</div>
</body>
</html>
本站原创文章转载注明来自www.111cn.net