Extension & Emerging Attributes

anchor

Historical experimental HTML association between a positioned element and an anchor identified by id. Do not rely on this attribute for production; use CSS anchor-name and position-anchor with a conventional positioning fallback. The example uses the CSS mechanism rather than the historical attribute.

Formal Syntax & Structure

html syntaxhtml
anchor="trigger"

Parameters & Attributes

NameTypeDescription
anchorID referenceHistorical anchor ID; not a portable current authoring mechanism.

Working Example

Example Snippethtml
<style>  #trigger{anchor-name:--trigger}#tip{position:absolute;position-anchor:--trigger;top:anchor(bottom);left:anchor(left);background:#eee;padding:4px}</style><button id="trigger">Info</button><p id="tip">Extra information</p>
HTML Reference