Fixed positioning
Fixed positioning is a CSS positioning mode that places an element relative to the viewport or a fixed-position containing block, keeping it stationary as document content scrolls.
CSS in Depth, Second Edition
Fixed positioning is a CSS positioning mode that removes an element from normal flow and positions it relative to the viewport or a containing block established for fixed positioning.
- How it is used
- Positions modal dialogs and desktop navigation against the viewport so they remain in place during scrolling.
- How deep it goes
- Works through viewport offsets, inset shorthands, a modal implementation, and stacking behavior; leaves built-in dialog behavior to the HTML dialog element.
- Examples
- Uses a scrolling modal with a full-viewport backdrop and a responsive navigation menu docked to the left.
- What you can do after
- Build it from scratch with CSS offsets, then diagnose overlaps by checking markup order and z-index.
Read how CSS in Depth, Second Edition explains fixed positioning →
Web Design Playground, Second Edition
Fixed positioning is a CSS positioning mode that places an element relative to the browser window and keeps it stationary during scrolling.
- How it is used
- Keeps navigation bars or footers visible during scrolling.
- How deep it goes
- Explains viewport anchoring and scrolling, then demonstrates offsets, stacking, and content clearance with a fixed footer.
- Examples
- Uses a photo-gallery footer, a fixed navigation-bar possibility, overlapping elements, and z-index layering.
- What you can do after
- Apply it via CSS by anchoring an element to the viewport and preserving content visibility beneath it.
Read how Web Design Playground, Second Edition explains fixed positioning →
Also covered in
- Architecting AccessibilityIn early access (MEAP)
- Web Design Playground
What to know first
- viewportA viewport is the visible region of a browser or graphical interface in which a document or other content is displayed.
- footer sectionA footer is a region associated with a document or section that contains closing or supplementary content, often positioned at the bottom.
- normal flowNormal flow is the browser’s ordinary layout process, arranging elements according to document order and their formatting behavior without out-of-flow positioning.
Related concepts
- viewportuses · A viewport is the visible region of a browser or graphical interface in which a document or other content is displayed.
- sticky positioningcontrasts with · Sticky positioning is a CSS positioning mode in which an element remains in normal document flow until a specified offset threshold is reached, then stays constrained within its containing block as scrolling continues.
- position propertyconfigured by · The CSS position property specifies an element’s positioning scheme and how positional offsets affect its layout.
- stacking contextproduces · A stacking context is an isolated CSS rendering context in which an element and its descendants are composited within the surrounding stacking order.
- absolute positioningcontrasts with · Absolute positioning is a CSS layout technique that removes an element from normal flow and positions it relative to a containing block, typically established by a positioned ancestor.
Questions about fixed positioning
What is fixed positioning?
Fixed positioning is a CSS positioning mode that places an element relative to the viewport or a fixed-position containing block, keeping it stationary as document content scrolls.
Which Manning books explain fixed positioning?
CSS in Depth, Second Edition and Web Design Playground, Second Edition.
What should I know before learning fixed positioning?
Manning books that teach fixed positioning usually introduce viewport, CSS unit, footer section and normal flow first.
What is the difference between fixed positioning and sticky positioning?
Fixed positioning is a CSS positioning mode that places an element relative to the viewport or a fixed-position containing block, keeping it stationary as document content scrolls. Sticky positioning is a CSS positioning mode in which an element remains in normal document flow until a specified offset threshold is reached, then stays constrained within its containing block as scrolling continues.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

