Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<link rel="author" href="mailto:jeroen.zwartepoorte@gmail.com">
<style>
.cases {
display: flex;
flex-wrap: wrap;
gap: 8px;
width: 642px;
}
.case {
position: relative;
box-sizing: border-box;
width: 122px;
height: 102px;
border: 1px solid silver;
}
.anchor {
position: absolute;
left: 20px;
top: 20px;
width: 50px;
height: 20px;
background: silver;
}
.probe {
position: absolute;
width: 20px;
height: 20px;
background: green;
}
.anchored {
left: 70px;
top: 40px;
}
.unanchored {
left: 20px;
top: 70px;
}
</style>
<div class="cases">
<!-- Parent gains a default anchor element. -->
<div class="case">
<div class="anchor"></div>
<div class="probe anchored"></div>
</div>
<!-- Parent loses its default anchor element. -->
<div class="case">
<div class="anchor"></div>
<div class="probe unanchored"></div>
</div>
</div>