CSS position-try-fallbacks Property
The position-try-fallbacks property lists the fallback positions an anchor-positioned element tries when it would overflow, such as flip-block.
Description
The position-try-fallbacks property gives an anchor-positioned element a list of alternative positions to use when its default position would overflow its containing block. The browser tries each option in turn and uses the first one that fits; if none fits it keeps the original position.
Each option can be a try-tactic, which transforms the element's current position: flip-block mirrors it across the anchor on the block axis (below becomes above), flip-inline mirrors it on the inline axis, and flip-start swaps the axes. Tactics can be combined, as in flip-block flip-inline. An option can also be a position-area value such as left, or the name of an @position-try rule that sets a whole new group of position properties.
.menu {
position-area: bottom span-right;
position-try-fallbacks: flip-block, flip-inline, --as-sheet;
}
This property was first shipped under the name position-try-options. Use position-try-order to prefer the option that gives the most space instead of the first one that fits.
Definition
- Initial value
- none
- Applies to
- absolutely positioned elements
- Inherited
- no
- Computed value
- as specified
- Animatable
- discrete
- JavaScript syntax
- object.style.positionTryFallbacks
Interactive Demo
Syntax
position-try-fallbacks: none | [ [ <dashed-ident> || <try-tactic> ] | <position-area> ]#;
Values
- noneThe default. No fallback options; the element stays in its default position even if it overflows.
- flip-blockTry the position mirrored across the anchor on the block axis (for example above instead of below).
- flip-inlineTry the position mirrored across the anchor on the inline axis (for example left instead of right).
- flip-startTry the position mirrored across the diagonal from start to end, swapping the inline and block positions.
- <dashed-ident>The name of an
@position-tryrule whose declarations replace the element's position properties for that option. It can be combined with try-tactics. - <position-area>A
position-areavalue to try, equivalent to an@position-tryrule that only setsposition-area. - initialSets the property to its initial value.
- inheritTakes the computed value of the parent element.
Example
Browser Support
The following information will show you the current browser support for the CSS position-try-fallbacks property. Hover over a browser icon to see the version that first introduced support for this CSS property.
Desktop





Tablets & Mobile





