I'm learning CSS from basis and have done a small sample: https://jsfiddle.net/L290pjwb/
div {
width: 50px;
height: 50px;
border: 1px solid black;
box-sizing: border-box;
}
.a {
position: static;
}
.b {
position: relative;
top: 10px;
left: 10px;
width: 100px;
height: 100px;
}
<div class="a">A</div>
<div class="b">B</div>
<div class="b">B1</div>
Boxes are located in such way:
All right, I understood, that position: static
is the default position model for HTML elements and it can't be relocated just by adding the top, bottom, right, left
properties. position: relative
is like static
, but offers some kind of offset
, which static
can't.
My question is: why isn't B1
box located like this:
?