solute;
  top: anchor(top);
  left: anchor(right);
  position-anchor: --anchor;
}

#outer-anchored {
  color: yellow;
  position: absolute;
  top: anchor(top);
  right: anchor(left);
  position-anchor: --anchor;
}
</style>

<div style="position: relative;">
  <div id="scroll-container">
    <div id="scroll-contents">
      <div id="placefiller-above-anchor"></div>
      <div id="placefiller-before-anchor"></div>
      <span id="anchor">anchor</span>
      <div id="inner-anchored">inner-anchored</div>
    </