Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-conditional/container-queries/style-query-attr-tainted.html - WPT Dashboard Interop Dashboard
<!doctype html>
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<title>Style queries and attr()</title>
<style>
#container {
--state: attr(data-state);
}
#child {
width: 100px;
height: 100px;
background-color: red;
@container style(--state: "good") {
background-color: green;
}
}
</style>
<p>Test passes if there is a filled green square.</p>
<div id="container" data-state="good">
<div id="child"></div>
</div>