[css-anchor-position-1][css-position] behavior of position-area when no anchor is defined · Issue #10500 · w3c/csswg-drafts (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@Afif13

Description

@Afif13

I just tried the below code:

.container { position: relative; } .element { position: absolute; inset-area: center; margin: auto; }

And to my surprise, it center the absolute element. Demo: https://codepen.io/t_afif/pen/OJYwybK

Based on the Specification the propety applies to "positioned elements with a default anchor element". Does it mean that any positioned element has a default anchor which is its containing block?

If it's the correct behavior, I think the Spec should clarify the "default anchor" part. Or maybe this is a bug and inset-area should have no effect?