[Inactive CSS] self-alignment properties are active on absolutely positioned elements
Categories
(DevTools :: Inspector: Rules, 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?
Reporter | ||
Updated•1 year ago
|
Comment 1•2 months ago
|
||
(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
Comment 2•2 months ago
|
||
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>
Description
•