Skip to main content

Positioning for CSSs

Positioning and responsive layout decide where elements sit in the page flow and how they adapt to screens. Normal flow, the position property with relative, absolute, fixed and sticky, floats and z-index control placement, while media queries and fluid units make a page respond to viewport width.

Stage: Layout · Part of the CSS roadmap · Last reviewed 19 November 2026

What to learn in Positioning

Positioning interview questions

What is the difference between position absolute and fixed?

An absolute element is placed relative to its nearest positioned ancestor and scrolls with the page. A fixed element is placed relative to the viewport and stays in place while scrolling. Both are removed from normal flow.

What does mobile-first mean in responsive CSS?

You write base styles for small screens, then use min-width media queries to add complexity for larger ones. This keeps mobile CSS simple, loads less override code on phones and forces content priorities to be clear.

Where Positioning fits in the CSS roadmap

Positioning belongs to the Layout stage (beginner level), which takes about 17 hours. Place things on the page.

Back to the full CSS roadmap