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-005-print.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Basic anchor positioning test for printing</title>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="match" href="anchor-position-005-print-ref.html">
<p>There should be a green square below, and no red.</p>
<div style="width:100px; height:100px; background:red;">
<div style="anchor-name:--first; width:50px; height:100px; background:green;"></div>
</div>
<div style="height:30px;"></div>
<div style="position:absolute; position-anchor:--first; top:anchor(top); left:anchor(right); width:50px; height:100px; background:green;"></div>
<p style="break-before:page;">There should be a green square below, and no red.</p>
<div style="width:100px; height:100px; background:red;">
<div style="anchor-name:--second; width:50px; height:100px; background:green;"></div>
</div>
<div style="height:30px;"></div>
<div style="position:absolute; position-anchor:--second; top:anchor(top); left:anchor(right); width:50px; height:100px; background:green;"></div>