Skip to content

Truly independent web browser

1.3 KB
Raw Blame
<!DOCTYPE html>
<title>Fallback and fragmented anchor</title>
<link rel="author" title="Morten Stenshorne" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#position-try-fallbacks">
<link rel="match" href="../../../../expected/wpt-import/css/css-anchor-position/../reference/ref-filled-green-100px-square.xht">
<style>
  #anchored {
    position: absolute;
    position-anchor: --a;
    bottom: anchor(top);
    right: anchor(left);
    width: 30px;
    height: 50px;
    position-try-fallbacks: flip-inline flip-block;
    background: green;
  }
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="position:relative; columns:2; width:100px; height:100px; column-fill:auto; gap:0; background:red;">
  <div style="position:absolute; left:20px; width:30px; top:0; bottom:0; background:green;"></div>
  <div style="position:absolute; left:50px; width:20px; top:50px; bottom:0; background:green;"></div>
  <div style="position:absolute; right:0; width:30px; top:0; height:50px; background:green;"></div>
  <div style="position:relative; height:200px;">
    <div style="width:20px; height:150px; background:green; anchor-name:--a;"></div>
    <div id="anchored"></div>
  </div>
</div>