JSFiddle - React, Tailwind, and code Playground
HTML
<div>Static</div>
<div>Relative</div>
<div>Absolute</div>
<div>Fixed</div>
<div>Floated</div>
CSS
* {
box-sizing: border-box;
}
body {
position: relative;
}
div {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100px;
text-transform: uppercase;
}
div:first-child {
position: static;
background: lightblue;
max-width: 400px;
}
div:nth-child(2) {
position: relative;
background: lightgray;
max-width: 600px;
}
div:nth-child(3) {
position: absolute;
top: 300px;
left: 0;
background: pink;
max-width: 300px;
}
div:nth-child(4) {
position: fixed;
top: 400px;
left: 8px;
background: lightgreen;
max-width: 500px;
}
div:nth-child(5) {
float: left;
background: lightyellow;
max-width: 200px;
}