All videosLayout & design
Create a fixed navbar

Create a fixed navbar

New version: https://youtu.be/GPadt8wmGXM

---

The position property allows you to move elements relative to: their current place in the document (relative), a parent element (absolute), or the viewport (fixed). Here we’ll be covering fixed position.

Fixed-positioned elements are completely removed from the document flow — meaning they no long touch or push other elements around them. They're pinned to the viewport, so they stay in place as the user scrolls, unlike absolute elements which are pinned to one of their parent elements.

We’ll be covering these concepts in this lesson:

  1. Enabling fixed position
  2. Positioning values
  3. Z-index

And then bring it all together with an example.