日期:2014-05-17  浏览次数:20672 次

div+css背景层适应的问题
<!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 "     xml:lang= "zh-CN "   lang= "zh-CN ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> </title>
<link   href= "css.css "   rel= "stylesheet "   type= "text/css "   media= "all "   />
</head>
<style>
#n1             {background:#eeeeee;width:300px}
#n2             {height:400px;width:300px}
</style>
<body>
<div   id= "n1 ">
<div   id= "n2 ">
s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p> s <p>
</div>
</div>
</body>
</html>

因为n2层设计时需设定高度,但当内容超过设定高度时!
在IE中n1层能适应n2层高度,FF就不能了,如何解决!?

------解决方案--------------------
针对ff,设定min-height,对ie设定height