I have 3 div
elements.
1st div
is bigger (wrap) and has position:relative;
2nd div
is positioned absolute to the 1st div
relative positioning (and is included in the 1st div
)
3rd div
is contained in the 2nd div
and also has absolute positioning.
<div id="1st">
<div id="2nd">
<div id="3rd"></div>
</div>
</div>
Why is the 3rd div
position absolute to the 2nd div
(which is also absolute position to the 1st div
) and not to 1st div
that has relative position ?
Because the 3rd div
is absolute positioning to the absolute positioned 2nd div
.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…