Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. CSS Course

Lesson 11 of 50 · css

Positioning

Duration: 11 mins

Four positioning schemes:

ValueBehaviour
staticNormal flow (default).
relativeOffset from its static position; keeps space in flow.
absoluteRemoved from flow; positioned relative to the nearest positioned ancestor.
fixedRemoved from flow; positioned relative to the viewport (stays on scroll).
stickyBehaves like relative until a scroll threshold, then becomes fixed.

Example: Sticky header

header { position:sticky; top:0; background:#fff; z-index:10; }
Previous: Display PropertyNext: Floating & Clearing