CKTIS / CSS
CSS property `position-area`
`position-area` selects a region of the 3×3 grid formed by the containing block and default-anchor edges, and that region becomes the positioned box’s containing block.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
none | <position-area>position-area selects a region of the 3×3 grid formed by the containing block and default-anchor edges, and that region becomes the positioned box’s containing block.
The example selects bottom center; Chromium places the label below its anchor, serializes the pair as center bottom, and leaves a second box using none at its ordinary coordinates.
Grammar: none | <position-area>.
A value has an effect only on a positioned box with a resolvable default anchor. For an area other than none, used auto insets and margins become zero, normal gains area-specific alignment, and size percentages and offsets resolve against the new containing block.
Examples
<!doctype html><meta charset="utf-8"><style>html,body{margin:0}.stage{position:relative;width:300px;height:200px}.anchor{position:absolute;left:100px;top:80px;width:40px;height:20px;anchor-name:--a}.tip{position:absolute;position-anchor:--a;width:20px;height:10px;position-area:bottom center;justify-self:center;align-self:start}.plain{position:absolute;left:200px;top:20px;width:20px;height:10px;position-area:none}</style><div class="stage"><i class="anchor"></i><b id="tip" class="tip"></b><b id="plain" class="plain"></b></div><pre id="result"></pre><script>const point=e=>{const r=e.getBoundingClientRect();return[Math.round(r.left),Math.round(r.top)]},a=point(tip),b=point(plain),x=getComputedStyle(tip).positionArea,y=getComputedStyle(plain).positionArea;if(a.join(',')!=='110,100'||b.join(',')!=='200,20'||x!=='center bottom'||y!=='none')throw new Error('position-area mismatch '+[a,b,x,y]);result.textContent='area='+a.join(',')+' '+x+'; none='+b.join(',')+' '+y;</script>Result
area=110,100 center bottom; none=200,20 none
The example selects `bottom center`; Chromium places the label below its anchor, serializes the pair as `center bottom`, and leaves a second box using `none` at its ordinary coordinates.