position-try-fallbacks
Newly availableSince 202688% of users
Part of the Anchor Positioning API, this property lets you define a list of 'backup' positions for an element. If the primary position would cause the element to overflow its container, the browser will try these fallbacks instead.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since January 2026. Widely available around July 2028.
The old way and the modern waySee the snippet: Tooltips that flip instead of overflowing →
Old way 8 lines
.tooltip {
position: fixed;
top: var(--top);
left: var(--left);
}
/* JS: on scroll and resize, measure the trigger and tooltip with
getBoundingClientRect(), compare against window.innerHeight,
flip above when it overflows, write --top and --left */Modern 10 lines
.trigger {
anchor-name: --trigger;
}
.tooltip {
position: absolute;
position-anchor: --trigger;
position-area: bottom;
position-try-fallbacks: flip-block, flip-inline;
}
/* no room below? the browser moves it on top */Newer parts of position-try-fallbacks
self-x-endBaseline Feb 2026self-x-startBaseline Feb 2026self-y-endBaseline Feb 2026self-y-startBaseline Feb 2026flip-xBaseline Jan 2026flip-yBaseline Jan 2026
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
none- Inherited
- No
- Applies to
- absolutely positioned elements
- Animation type
- discrete
Quick example
.tooltip {
position: absolute;
position-anchor: --my-btn;
position-area: top center;
/* If the tooltip doesn't fit at the top, try the bottom then the right */
position-try-fallbacks: bottom center, right center;
}Values
noneposition-areaRelated snippet
Tooltips that flip instead of overflowingLayout →position-try-fallbacks browser support
BaselineNewly availableSince 2026 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.Works in all modern browsers. May need a fallback for older browsers.
Usage88%of people can use this12% use a browser without it.
Browsers
128+
147+
26+
128+Mobile
128+Android
147+Android
26+iOS
Interop 2026 focus area. All major browsers are actively working to fix cross-browser inconsistencies for this feature in 2026. Learn more →