spaceplus
小狐狸
小狐狸
  • UID8149
  • 注册日期2005-08-22
  • 最后登录2005-12-03
  • 发帖数7
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
阅读:3166回复:4

请问一下,这个是不是FF的盒模型解析错误?

楼主#
更多 发布于:2005-08-28 08:50
代码如下:


/*初始化*/
*{
	margin: 0px;
	padding: 0px;
	border: 0px;
}
/*符合标准的假想 margin 区域*/
#cc{
	background: #C0C0C0;
	width: 360px;
	height: 160px;
}
/*实际盒模型*/
#center2{
	background: #9ACD32;
	border: 10px solid #FFE4E1;
	margin: 10px;
	padding: 10px;
	width: 300px;
	height: 100px;
}

<div id="cc">
<div id="center2">gggg</div>
</div>


这样的代码在IE中显示很正常。但在FF中 把模型 center2的margin应用到了外部模型 cc当中。真是想不通。

为什么模型 center2不参照 父级模型 cc? 而参照最外层的 body模型?

W3C的 Definition of "containing block" 中有这样的一段话。
For other elements, unless the element is absolutely positioned, the containing block is formed by the content edge of the nearest block-level ancestor box.


参考原文地址:http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#containing-block-details

哎!!现在是越学越糊涂。
spaceplus
小狐狸
小狐狸
  • UID8149
  • 注册日期2005-08-22
  • 最后登录2005-12-03
  • 发帖数7
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
1楼#
发布于:2005-08-28 08:50
真么没人回复呢?唉!!!自己先顶一下。
游客

返回顶部