[csswg-drafts] [css-anchor-position] Anchor Element's "Containing Block" (#12674)

dshin-moz has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-anchor-position] Anchor Element's "Containing Block" ==
[Acceptable anchor element](https://drafts.csswg.org/css-anchor-position-1/#acceptable-anchor-element) uses containing blocks of positioned and anchor elements. 

If the anchor element is statically positioned, then its [containing block](https://www.w3.org/TR/CSS2/visudet.html#containing-block-details) is the nearest **block** container. The positioned element may use absolute positioning, then the containing block is the nearest 'position: absolute|relative|fixed' container, irrespective of it being a block or inline container.

According to above, given:

```
<div id=block>
  <span id=inline style="position: relative;">
    <span id=anchor style="anchor-name: --a;">Anchor</span>
    <span id=positioned style="position: absolute; position-anchor: --a; left: anchor(right); top: anchor(bottom);">Positioned</span>
  </span>
</div>
```

`#positioned` can't anchor to `#anchor`, because `#anchor`'s containing block is `#block`, but `#postioned`'s containing block is `#inline`, and hence `#positioned`'s containing block is **not** an ancestor of `#anchor`?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12674 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 28 August 2025 13:40:37 UTC