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/position-area-pseudo-element-implicit-anchor.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Implicit anchor element for pseudo-elements using anchor functions</title>
<link rel="match" href="position-area-pseudo-element-implicit-anchor-ref.html">
<style>
body { margin: 0 }
#target {
margin-top: 100px;
margin-left: 50px;
width: 100px;
height: 100px;
background: blue;
}
#target::before, #target::after {
width: 100px;
height: 100px;
position: absolute;
}
#target::before {
position-area: center right;
background: green;
content:'';
}
#target::after {
position-area: bottom center;
background: green;
content:'';
}
</style>
<div id=target></div>