CSS Positioning: Relative, Absolute, and Fixed

CSS Positioning Overview

CSS Positioning allows you to control the placement of elements on a webpage. There are four main types of positioning in CSS:

CSS Positioning Examples

Relative Box
Relative Child
Absolute Box
Absolute Child
Fixed Box (stays at the top-right of the screen)

Quiz: Test Your Knowledge on CSS Positioning

1. What does the `position: relative;` property do?




2. What does the `position: absolute;` property do?



3. What does the `position: fixed;` property do?