Skip to content

Commit

Permalink
fix(css): for sticky value an inset property need to be set
Browse files Browse the repository at this point in the history
  • Loading branch information
OnkarRuikar committed Oct 20, 2023
1 parent 82dda1f commit 42f07ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions files/en-us/web/css/position/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ position: unset;

This value always creates a new [stacking context](/en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context). Note that a sticky element "sticks" to its nearest ancestor that has a "scrolling mechanism" (created when `overflow` is `hidden`, `scroll`, `auto`, or `overlay`), even if that ancestor isn't the nearest actually scrolling ancestor.

At least one [inset](/en-US/docs/Web/CSS/inset) property on the axis in which the element needs to be kept in view needs to have non `auto` value. Otherwise, if both inset properties are `auto` on an axis then the `sticky` value behaves as `relative` on that axis.

## Description

### Types of positioning
Expand Down

0 comments on commit 42f07ea

Please sign in to comment.