All examples

Tooltips & toggletips > Anchor positioning
Anchored chat box

This chat box is anchored to the button that triggers it.

Example code

							<button popovertarget="p" id="c" draggable="true">
	Open chat
</button>

<div popover id="p">
	Chatbox
</div>

<style>
	#c { 
		anchor-name: --chat-opener;
		width: fit-content;
		position: fixed;
		bottom: 1em;
		right: 1em;
	}
	#p {
		position: absolute;
		position-anchor: --chat-opener;
		position-area: top left;
		position-try-fallbacks: flip-inline;
	}
</style>
						

Preview

Browser support