Open Bug 1895193 Opened 1 year ago Updated 2 months ago

[Inactive CSS] self-alignment properties are active on absolutely positioned elements

Categories

(DevTools :: Inspector: Rules, task)

task

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

References

(Blocks 2 open bugs)

Details

https://drafts.csswg.org/css-anchor-position-1/#anchor-center:

The self-alignment properties allow an absolutely-positioned element to align itself within the inset-modified containing block

Not sure if the element needs to have an anchor element though?

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #0)

Not sure if the element needs to have an anchor element though?

If no anchor element is defined, there is no "default anchor box", which lets anchor-center behave like the center value. So technically it doesn't, though without anchor element, it falls back to center. I.e. it still has an effect and is therefore not inactive, though we might still show a hint explaining this.

Sebastian

Self-alignment WORKS on abspos regardless of anchor positioning:
https://drafts.csswg.org/css-align/#justify-self-property
https://drafts.csswg.org/css-align/#align-self-property

A hint mentioning anchor positioning would just confuse authors who are not using anchor positioning.

<!DOCTYPE html>
<div style="position: relative; width: 100px; height: 100px; border: solid">
  <div style="position: absolute; inset: 0; background: lime; place-self: center;">center!</div>
</div>
You need to log in before you can comment on or make changes to this bug.