css:position:absolute_vs_relative_vs_static
This is an old revision of the document!
Table of Contents
CSS - Position - Absolute vs Relative vs Static
index.html
<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>https://wiki.sharewiz.net/doku.php?id=css:position:absolute_vs_relative_vs_static&do=edit
style.css
.parent { border: 2px black dotted; display: inline-block; }.box { display: inline-block; background: red; width: 100px; height: 100px; }#two { background: green; }
<html> <style> .parent { border: 2px black dotted; display: inline-block; }.box { display: inline-block; background: red; width: 100px; height: 100px; }#two {
background: green;
} </style>
One
Two
Three
Four
</html>
css/position/absolute_vs_relative_vs_static.1628424210.txt.gz · Last modified: 2021/08/08 12:03 by peter