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

奇怪的margin-top问题
HTML code
<!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=utf-8" />
</head>
<body>
<div style="height:419px;width:192px;background:url(images/1263871225.jpg)">
  <div style="margin-top:100px">
  
  </div>
</div>
</body>
</html>

这段代码在firefox或者ie8下面(其他浏览器没去试)都出现 内层div的margin-top撑开外层的现象
请教各位这是什么原因
附上图片

------解决方案--------------------
在父元素设置overflow:hidden;方可解决问题 还有问题发站内邮箱 明日帮你解决