CSS Positioning in Webflow: Everything You Need

Intermediate 33:52 webflowcsspositionstickyz-index

Master position in Webflow — static, relative, absolute, fixed, and sticky — plus how offsets, stacking, and reference containers actually behave.

Key takeaways

  • static is the default — the element stays in normal flow; you can still nudge it visually with a move transform without disturbing its neighbors.
  • relative keeps the element in flow but unlocks offsets (top/right/bottom/left) and z-index, so it shifts visually while everything around it stays put.
  • absolute removes the element from flow and anchors it to the nearest ancestor with a non-static position — falling back to the body if none exists.
  • fixed also leaves the flow but always anchors to the viewport, ignoring its ancestors entirely — ideal for navbars and floating UI.
  • sticky is a hybrid: it flows normally until a scroll offset is reached, then locks to its scrollable container — and it silently breaks if any ancestor has overflow other than visible or clip.
  • Percentage offsets mean different things per position: relative → the parent, absolute → the containing block, fixed → the viewport, sticky → the scrollable container.

Video chapters

  1. 00:00 Intro
  2. 01:32 Position Static
  3. 03:56 Position Relative
  4. 08:55 Position Absolute
  5. 15:24 Position Fixed
  6. 20:59 Position Sticky
  7. 27:24 Bonus: real-world sticky use cases
  8. 32:29 Outro

By the end of this lesson you’ll finally have position figured out — static, relative, absolute, fixed, and sticky — not as five vocabulary words, but as five predictable behaviors you can reach for on purpose. Once it clicks, you build cleaner layouts and fix alignment problems before they become problems.

Positioning looks simple and then quietly confuses everyone at some point: the offsets don’t do what you expect, an element vanishes, or a sticky refuses to stick. The trick is that each value answers two questions — am I still in the normal flow? and what do my offsets measure against? Get those two straight for each value and the whole property stops being mysterious.

Let’s go through all five with the same tiny setup — a card with a badge inside — so you can see exactly what changes when you flip one property.

How it works

Static is the default. It means “leave me alone, I’m part of the normal flow” — one block after another, no floating, no overlapping. You can’t use offsets on a static element, but you can still shift it visually with a move transform, and the layout behaves as if it never moved (percentages in a transform are relative to the element’s own size). It’s the do-nothing setting, and sometimes that’s exactly right.

Relative looks identical to static until you use it — the element stays in the flow. What it unlocks is offsets (top/right/bottom/left) and z-index. Offsets shift the element visually without affecting anything around it, so left: 4rem slides it over while its neighbors act like it never left. It’s also how you control stacking order independent of DOM order. But the real reason relative matters comes next: it’s the anchor for absolute children. (Percentage offsets here are relative to the parent — and get unreliable if the parent has no defined height or uses flex/grid.)

Absolute takes the element out of the flow — everything else reclaims its space as if it were gone — and anchors it to a reference point: the first ancestor with a non-static position. Set the parent to relative and an absolute badge with top: 0; left: 0 pins to the card’s corner. Remove that relative and the badge jumps to the next positioned ancestor up the tree, or the body if there is none. With no offsets at all, it stays visually where it was but stops affecting layout. Percentage offsets are relative to that reference (the containing block). This is your tool for anchoring one element to another — a badge, a decorative image in a hero corner, a tooltip.

Fixed also leaves the flow, but here’s the key difference: it always anchors to the viewport, no matter what its ancestors do. Give the badge top: 0; right: 0 and it pins to the corner of the screen and stays there as you scroll. Percentages are relative to the viewport. One gotcha worth knowing: a fixed element still belongs to the stacking context of the section it lives in, so later sections with their own z-index can cover it — the fix is to raise the parent section’s z-index, not the element’s. The classic use is a fixed navbar (e.g. position: fixed; top: 1rem; left: 1rem; width: calc(100% - 2rem) to sit it neatly inset from both edges).

Sticky is the hybrid — relative until a scroll threshold, then fixed. Apply it with a top: 0 and nothing happens until the element’s top edge reaches the top of the scroll container; then it locks there and rides along until its parent ends, at which point it lets go. It works on any edge (sticky-top, sticky-bottom, and even sticky-left inside a horizontally scrollable container), and its offsets are measured against the nearest scrollable ancestor. The big gotcha: sticky breaks if any ancestor has overflow set to anything other than visible or clip (auto, scroll, or hidden all kill it), because it can no longer measure the flow it needs. If a sticky won’t stick, check the parents first.

How to use it

  1. Anchor a badge to a card corner. Give the card position: relative, give the badge position: absolute, then pick a corner (e.g. top: 0; left: 0, or Webflow’s bottom-left preset). The badge sits exactly where you want and never disturbs the card’s text.
  2. Build a fixed navbar. Set the navbar to position: fixed, top: 1rem, left: 1rem, and width: calc(100% - 2rem). The left offset plus the calc width leave equal breathing room on both sides while it stays pinned to the top.
  3. Keep fixed UI visible across sections. If your floating button or badge disappears past the first section, raise the z-index of its parent section (not just the element) so its whole stacking context wins.
  4. Pin a table of contents. In a two-column grid, set the TOC to position: sticky; top: 150px. If it won’t stick, change the grid’s vertical alignment to top so the TOC only takes the height it needs and has room to move.
  5. Keep the first column of a scrollable table visible. In a horizontally overflowing flex row, give the first column position: sticky; left: 0 — it stays locked to the left while the rest scrolls.
  6. Add a revealing footer. Set the footer to position: sticky; bottom: 0. That single property gives you the “footer revealed on scroll” effect with no interactions or code.
  7. When something misbehaves, check two things: is an ancestor’s overflow breaking your sticky, and is your z-index fighting a stacking context you didn’t notice?

Nail these five and positioning stops being guesswork. Each value is just a clear answer to “in the flow or not?” and “measured against what?” — and once you know both, you can place anything, anywhere, on purpose.

Resources

Frequently asked questions

What's the difference between absolute and fixed positioning in Webflow?
Both remove an element from the normal flow, but absolute anchors to the nearest ancestor with a non-static position (or the body if none exists), while fixed always anchors to the viewport and ignores its ancestors. Use absolute for a badge inside a card, fixed for something that must stay on screen while you scroll.
Why isn't my sticky element sticking in Webflow?
The usual culprit is an ancestor with overflow set to auto, scroll, or hidden — sticky needs a visible flow to measure against, so any such ancestor breaks it. The other cause is no room to move: give the parent enough height, or set the grid/flex alignment to top so the element only takes the height it needs.
What does an element with position absolute anchor to?
It anchors to the first ancestor with a position other than static — relative, absolute, fixed, or sticky. If none qualifies, it falls back to the body. That's exactly why you usually set the parent to relative before making a child absolute.
How do I keep a fixed element above the sections that come after it?
A fixed element belongs to the stacking context of the section it lives in, so a later section with its own z-index can cover it. Raising the fixed element's z-index alone won't help — raise the z-index of its parent section so the whole context sits above the others.
When should I use position relative if it doesn't move the element?
relative is mostly a setup step: it keeps the element exactly where it is while unlocking offsets and z-index, and — most importantly — it turns the element into the reference point for any absolutely positioned children. Reach for it before positioning something absolute inside it.

← Back to the course

Also part of these courses