Park cars in the right slots with position: 24 levels of static, relative, absolute and sticky. The most visual CSS position game around.
position: relative shifts an element from its original spot without changing the layout of other elements. The element still "remembers" where it came from.
position: absolute pulls the element out of the normal flow and positions it relative to the nearest ancestor that has a position (other than static). If there is none, the element is positioned relative to the viewport.
When a parent has position: relative, a child with position: absolute is positioned relative to that parent, not the viewport. This is a very common pattern in CSS.
z-index controls the stacking order of overlapping elements. An element with a higher z-index appears above one with a lower z-index. z-index only works on elements that have a position other than static.
position: fixed positions an element relative to the viewport (the browser window). The element stays put even when the page is scrolled. Commonly used for navbars or floating buttons.
position: sticky is a mix of relative and fixed. The element behaves like relative until a certain scroll threshold, then "sticks" like fixed. It must have at least one offset (top, bottom, etc.).
position: relative and left.position: relative and top.position: relative with left and top.position: absolute, then measure from the corner with top and left.position: absolute and measure from the right and bottom sides.top: 60px and left: 100px from the lot's corner, with position: absolute.top: 80px and left: 120px, with position: absolute..parkiran is already position: relative, so the lot's corner is the point to measure from. Park the blue minibus absolutely at top: 20px, left: 20px.top: 10px; left: 10px, the blue minibus at top: 10px; right: 10px. Both absolute inside the lot.top: 10px; left: 10px, blue motorbike top: 80px; left: 130px, pedicab bottom: 10px; right: 10px.top: 50px; left: 80px, the orange motorbike at top: 120px; left: 180px.And more, 24 levels in all.