<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);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.