Consider the following HTML markup:
<div><span></span></div>
and a stylesheet:
div {
border: 5px solid yellow;
position: absolute;
width: 200px;
height: 200px;
margin: 40px auto;
}
span {
position: absolute;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
background: aqua;
}
It's OK. Content is displayed as I'm expected: jsFiddle.
But if I'm trying to delete position:absolute
from the div
, then something incomprehensible is occuring. jsFiddle after deleting absolute position of div.
Q: Why span
get out from the border of parent div and div's positioning scheme is influenced to span
rendering?