<div class="red"></div>
<div class="blue"></div>
<div class="purple"></div>

    .red, .purple, .blue {
      height: 100px;
    }

    .red {
      background-color: red;
      position: absolute;
      top: 10px;
      left: 10px;
      width: 100px;
      anchor-name: --red;
    }

    .blue {
      background-color: blue;
      position: absolute;
      top: 10px;
      right: 10px;
      width: 100px;
      anchor-name: --blue;
    }

    .purple {
      background-color: purple;
      position: absolute;
      top: 10px;
      left: anchor(--red right);
      right: anchor(--blue left);
    }

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.