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-center-no-default-static-position.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Anchor Positioning: justify-self: anchor-center behaves as center on a box at its static position with no default anchor</title>
<link rel="match" href="anchor-center-no-default-static-position-ref.html">
<style>
.containing-block {
position: relative;
width: 200px;
height: 50px;
}
.box {
position: absolute;
justify-self: anchor-center;
width: 50px;
height: 50px;
background: green;
}
.rtl {
direction: rtl;
}
</style>
<div class="containing-block"><div class="box"></div></div>
<div class="containing-block rtl"><div class="box"></div></div>