Skip to main content
InterviewHubPRO
Section Overview
Q5

Question 5 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

10%
CSS3 & Modern Layouts (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

What are the CSS Positioning schemes (`static`, `relative`, `absolute`, `fixed`, `sticky`)?

junior LevelcssBasic

In Simple Words:

  • static (Default): Normal document flow. Ignores top, bottom, left, right, and z-index.
  • relative: Positioned relative to its normal static position. Offsetting it with top: 10px shifts its visual appearance while preserving its original occupied space in the document layout. Acts as an anchor for absolute children.
  • absolute: Removed from normal document flow. Positioned relative to the nearest ancestor that has a position other than static (or the viewport if none exists).
  • fixed: Removed from document flow. Positioned relative to the browser viewport. Stays pinned in place during page scrolling (e.g., sticky header or modal overlay).
  • sticky: Hybrid. Behaves as relative until the element reaches a designated scroll threshold (e.g. top: 0), at which point it acts as fixed within the boundaries of its parent container.