Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-viewport/zoom/container-queries-height.html - WPT Dashboard Interop Dashboard
<!doctype html>
<link rel="match" href="reference/container-queries-height-ref.html">
<style>
.container {
container-type: size;
width: 100px;
height: 100px;
}
.child {
background-color: green;
height: 50px;
width: 50px;
@container (height > 120px) {
background-color: red;
}
}
</style>
<p>All boxes below should be green.</p>
<div class="container">
<div class="child"></div>
</div>
<div class="container" style="zoom: 2">
<div class="child"></div>
</div>
<div class="container" style="zoom: 2">
<div class="nested" style="zoom: 2">
<div class="child"></div>
</div>
</div>
<div class="outer" style="zoom: 2">
<div class="container">
<div class="child"></div>
</div>
</div>