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
- Explain normal flow and the difference between block and inline elements
- Position a badge with absolute inside a relative container
- Make a header stick to the top with position: sticky
- Write a mobile-first media query that changes layout at a breakpoint
- Use clamp and viewport units for fluid sizing
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.