// relative: Positions the element relative to its normal positon and will leave a gap at its normal position * /
// position: relative; * /
// absolute: Positions the element relative to the positon of its first parent * /
// position: absolute; * /
// top: 34px; left: 134px; * /
// fixed: Positions the element relative to the browser window; * /
// position: fixed;
//right: 4px; bottom: 2px * /
// sticky
// position:sticky
// top:3px
position: absolute;top: 50px;
position: absolute;
@media screen { h1#first { position: fixed; }}@media print { h1#first { position: static; }}
position: fixed;
.relative {
position: relative;
width: 600px;
height: 400px;
}
.absolute {
position: absolute;
top: 120px;
right: 0;
width: 300px;
height: 200px;
}
<div class=”parent”> <div class=”box” id=”one”>One</div> <div class=”box” id=”two”>Two</div> <div class=”box” id=”three”>Three</div> <div class=”box” id=”four”>Four</div></div>