Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-backgrounds/background-clip/clip-text-stacking-context-child.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>background-clip:text with stacking context children</title>
<link rel="match" href="clip-text-stacking-context-child-ref.html">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
.clip {
font: 50px/1 Ahem;
color: transparent;
background-color: green;
background-clip: text;
}
</style>
<!-- Test passes if there are 8 5-character green texts. -->
<!-- opacity creates stacking context -->
<div class="clip">XXXXX<div style="opacity: 0.99">XXXXX</div></div>
<!-- transform creates stacking context -->
<div class="clip">XXXXX<div style="transform: translateX(0)">XXXXX</div></div>
<!-- will-change creates stacking context -->
<div class="clip">XXXXX<div style="will-change: opacity">XXXXX</div></div>
<!-- filter creates stacking context -->
<div class="clip">XXXXX<div style="filter: opacity(1)">XXXXX</div></div>