property

Position try fallbacks — CSS reference

Lists alternate positions or named @position-try options. If the default position overflows its inset-modified containing block, the browser considers alternatives until one fits. A previously successful option may be retained while it still fits; the browser need not immediately return to the preferred placement. If no option fits, do not assume the browser will guarantee visibility.

Formal Syntax & Structure

css syntaxcss
position-try-fallbacks: flip-block;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>position-try-fallbacks</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}#stage{position:relative;width:300px;height:220px;background:#f1f5f9;outline:1px solid #64748b}#a{position:absolute;left:100px;top:70px;width:60px;height:30px;padding:0;anchor-name:--trigger}#b{position:absolute;position-anchor:--trigger;width:80px;height:45px;background:#2563eb;color:white;box-sizing:border-box;padding:4px}#a{top:180px}#b{position-area:bottom}#b{position-try-fallbacks:flip-block}</style><body><div id="stage"><div id="a">Anchor</div><div id="b">Note</div></div></body></html>
CSS Reference