- From: Mason Freed via GitHub <sysbot+gh@w3.org>
- Date: Tue, 11 Jun 2024 22:14:15 +0000
- To: public-css-archive@w3.org
So this is correct behavior, per spec. Your anchor element is **absolutely** positioned inside the `position:relative` containing block. Your "anchee" (better to use "positioned element", for future reference) is **fixed** positioned, so its containing block is the ICB. And https://drafts.csswg.org/css-anchor-position-1/#acceptable-anchor-element says: - If el has the same [containing block](https://drafts.csswg.org/css-display-4/#containing-block) as query el, then either el is not [absolutely positioned](https://drafts.csswg.org/css-position-3/#absolute-position), or el precedes query el in the tree order. Here, *el* is "anchor" and *query el* is "anchee". And this point isn't true, because "anchor" is absolutely positioned, and "anchee" comes **after** "anchor" in the layout tree, again because "anchee" is fixed positioned. So "anchor" is **not** an acceptable anchor element for "anchee". As mentioned above, change "anchor" to `position:fixed` and you'll be good. Or remove `position:relative` from the wrapper, so both have the same ICB containing block. -- GitHub Notification of comment by mfreed7 Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10419#issuecomment-2161691773 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 11 June 2024 22:14:16 UTC