在div上的相对设置是否使它脱离文档流? [英] Does setting position to relative on a div takes it out of document flow?
问题描述
只是在div上声明 position:relative
,而不指定位置坐标(如top,left等)会使它脱离正常文档吗? Plz提供推理。
Does just declaring position:relative
on a div without specify position coordinates such as top,left etc takes it out of normal document ? Plz provide reasoning.
感谢
dkj。
thanks dkj.
推荐答案
不,它不。 相对
定位不影响布局,定位元素仍然在其起始位置 ,因此 / strong>。
No it doesn't. relative
positioning doesn't affect the layout, the positioned element is still in its initial place logically, hence the occupied space is reserved.
但它可以通过顶部
,<$> c $ c> right , bottom
, left
offsets / properties。
But it could be displaced visually by top
, right
, bottom
, left
offsets/properties.
9.3.1 Choosing a positioning scheme: 'position' property
/ code>
框的位置是根据正常流量(这称为正常流量中的位置)。然后
该框相对于其正常位置偏移。当盒子B是
相对定位时,下一盒子的位置被计算为
,就像B没有偏移一样。 [...]
relative
The box's position is calculated according to the normal flow (this is called the position in normal flow). Then
the box is offset relative to its normal position. When a box B is
relatively positioned, the position of the following box is calculated
as though B were not offset. [...]
这篇关于在div上的相对设置是否使它脱离文档流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!