.tooltip {
position: absolute;
position-anchor: --my-anchor;
position-area: top;
position-try-fallbacks: flip-block;
container-type: anchored;
}Using anchored container queries / notebook
Using anchored container queries
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
@container anchored(fallback: flip-block) {
/* Descendant styles here */
}<div class="anchor">⚓︎</div>
<div class="infobox">Infobox</div>