CSS positioning allows you to precisely control the placement of elements on the page.
.static-element { position: static; /* Default positioning */ /* Element follows normal document flow */ }
.relative-element { position: relative; top: 20px; left: 30px; /* Positioned relative to its normal position */ }
.absolute-element { position: absolute; top: 50px; left: 100px; /* Positioned relative to nearest positioned ancestor */ }
.fixed-element { position: fixed; top: 0; right: 0; /* Positioned relative to viewport */ z-index: 1000; }
.sticky-element { position: sticky; top: 10px; /* Sticks to viewport when scrolling */ }
.higher-element { position: relative; z-index: 10; } .lower-element { position: relative; z-index: 5; }