专注于网络营销与传统企业的结合
发布:admin | 分类:学习教程资料 | 引用:0 | 浏览:
21 May 2010<!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=gb2312" />
<title>解决ie6 7 8 ff chrome div高度自动增加问题 by saruri </title>
</head>
<body style="padding:0px; margin:0px; min-height:300px;">
<style>
.abc{ width:940px; min-height:60px;
max-height:none; border:1px solid #999; background-color:#060;}
.cde{width:940px;
max-height:none; border:1px solid #999; background-color:#060;}
.fgh{width:940px;
height:60px; max-height:none; border:1px solid #999; background-color:#060;}
</style>
<div class="abc">
<p>因为只有ie6的div高度是自动增加的 所以在别的就出现了内容溢出用auto没有用的 需要用min-height和max-height来实现,相似的问题我在别的问题里已经回答过了.</p>
<p><strong>
第三个层固定高度其他的高度自适应 min-height 和max-height 是ie 7 8 ff chrome支持的 ie6div高度自适应 用不着</strong></p>
<p>如果div里有float <br>那么<br>加入清除浮动 clear的div可以解决内容溢出问题<br>容内容内容内容内<br>容内容内容内容内容内容内容内容内容内容内容内容
内容内容内容内容内容内容内容内容内容<br>内容内容内<br>容内容内容内容内容内容内容内<br>容内容内容内容内<br>容内容内容内容内容内容内容内容内容内容内容内容</p>
</div>
<div class="cde">
<br>
内容内容内容内容内容内容内容内容内容<br>内容内容内<br>容内容内容内容内容内容内容内<br>容内容内容内容内<br>容内容内容内容内容内容内容内容内容内容内容内容
内容内容内容内容内容内容内容内容内容<br>内容内容内<br>容内容内容内容内容内容内容内<br>容内容内容内容内<br>容内容内容内容内容内容内容内容内容内容内容内容
</div>
<div class="fgh"></div>
</body>
</html>
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
0评论 - css高度自适应的简单方法