当我阅读规范时,我发现您的问题实际上得到了很好的回答:
内嵌盒包含一个块框时,该内嵌框在块周围断裂。中断前和中断后的[in]内嵌框都包含在匿名框中,而阻止框将成为这些匿名框的同级。
<BODY >This is anonymous text before the P.<P>This is the content of P.</P>This is anonymous text after the P.</BODY>
结果框将是围绕BODY的匿名阻止框,其中包含C1周围的匿名阻止框,P阻止框和C2周围包含另一个匿名阻止框。
或者,在视觉上:
+- anonymous block box around body ---+| +- anonymous block box around C1 -+ || |+ || +---------------------------------+ || || +- P block box -------------------+ || |+ || +---------------------------------+ || || +- anonymous block box around C2 -+ || |+ || +---------------------------------+ |+-------------------------------------+
现在您的问题是:这与
<BODY >?
是的。虽然它仍然是4个盒子( 身体周围的匿名阻止盒子 现在是 BODY阻止盒子 ),但规格说明 了区别 :
在元素上设置的导致生成匿名块框的属性仍然适用于该元素的[生成的匿名块]框和内容。
例如,如果在上面的示例中在BODY元素上设置了边框,则将在C1(在行的结尾处打开)和C2(在行的开头处打开)周围绘制边框:
+--------------------------------------| This is anonymous text before the P. +-------------------------------------- This is the content of P. --------------------------------------+ This is anonymous text after the P. | --------------------------------------+
这不同于
<BODY >:
+--------------------------------------+| This is anonymous text before the P. || || This is the content of P. || || This is anonymous text after the P. |+--------------------------------------+



