ccc
So you have to be thinking about the
position
value quite a bit. There is almost a 100% chance that the element you’re trying to position to an anchor is
position: absolute;
. It’s the anchor itself that’s more concerning. If they are siblings, and the anchor has any
position
value other than the default
static
, the anchor
has
to come first. If they are in other positions in the DOM, like the anchor is a parent or totally elsewhere, you need to ensure they are in the same “containing block” or that the anchor parent still has that
static
positioning. Again, Temani has
a deeper dive
into this that explains it well.