← Back to CSS Programs | Home

CSS Positioning

1. Static Position

This box uses position: static.

2. Relative Position

This box uses position: relative.

3. Absolute Position

Parent container

Absolute Box

4. Sticky Position

I am a Sticky Header — scroll the page!

Scroll down to observe the sticky element.

CSS positioning controls where an element appears on a webpage.

5. Fixed Position

The purple box stays fixed at the bottom-right of the screen.

Fixed Box