source spec: Anonymous block boxes.
I'm confused about this sentence.
When such an inline box is affected by relative positioning, any resulting translation also affects the block-level box contained in the inline box.
I don't know whether the "relative positioning" is the general meaning, I mean it can be absolute
or fixed
, and other properties of display
, e.g, inline-block
.
Let's see examples.
I know DIV
broke the line box
, but position: relative
seems useless, I can remove it directly.
.father {
position: relative;
border: 1px solid red;
}
<span class="father">
<div>Hi Wick</div>
</span>
But, If I modified relative
to absolute
, I knew the line box
wasn't "broke", so border
worked normally. If I added the inline-block
property of display
, the result is the same.
.father {
position: absolute;
border: 1px solid red;
}
<span class="father">
<div>Hi Wick</div>
</span>
Also, what does any resulting translation
mean? I know some behaviors may change containing block
, so they will be affected by their descendants. I'm not sure whether it is about the containing block
.
Therefore, I need some examples!