Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-anchor-position/anchor-position-inline-008.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Anchor Positioning Test: Resolve anchor() and anchor-size() when the anchor element is an inline element with block children</title>
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="match" href="anchor-position-inline-008-ref.html">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
.rel {
position: relative;
background: lightgray;
}
.anchor {
anchor-name: --a;
}
.target {
position: absolute;
position-anchor: --a;
top: anchor(top);
left: anchor(left);
width: anchor-size(width);
height: anchor-size(height);
background: green;
}
</style>
<div style="font: 20px/1 Ahem; width: 11em">
<div class="rel">Lorem ipsum
<span class="anchor">dolor<div style="width: 6em; background: gold">sit</div>amet</span>
<span class="target"></span>
</div>
</div>