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/anchored-c-v-hidden.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Anchor Positioning Test: Anchor positioned element with content-visibility:hidden</title>
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<style>
#anchor {
anchor-name: --a;
width: 100px;
height: 100px;
}
#anchored {
position: absolute;
position-anchor: --a;
position-area: center;
content-visibility: hidden;
width: 100px;
height: 100px;
background-color: green;
}
#fail { background-color: red; }
</style>
<p>Test passes if there is a filled green square.</p>
<div id="anchor"></div>
<div id="anchored">
<div id="fail">FAIL</div>
</div>