Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<link rel="match" href="grid-position-area-basic-ref.html">
<style>
#grid {
display: grid;
grid: 150px 100px / 200px 300px;
padding: 20px;
position: relative;
border: 1px solid;
}
#positioned {
position: absolute;
background: magenta;
grid-column: 1 / 2;
grid-row: 1 / 2;
position-anchor: --foo;
position-area: top right;
/* FIXME: Shouldn't be needed */
width: fit-content;
height: fit-content;
}
#static {
background: pink;
grid-column: 1 / 2;
grid-row: 1 / 2;
}
#anchor {
background: lime;
grid-column: 2 / 3;
grid-row: 2 / 3;
anchor-name: --foo;
}
.abs-cb {
width: 600px;
height: 600px;
position: relative;
}
</style>
<div id="grid">
<div id="anchor"></div>
<div id="positioned">Anchored</div>
<div id="static"></div>
</div>