Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-images/image-color-layered.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Images Module Level 4: image(<color>) as a background-image layer</title>
<link rel="author" title="Jason Leo" href="mailto:cgqaq@chromium.org">
<link rel="match" href="image-color-layered-ref.html">
<style>
div {
width: 100px;
height: 100px;
display: inline-block;
margin: 4px;
background-color: red;
}
/* The first listed background-image paints on top, so an opaque
image(green) fully covers the lower image(red) layer. */
.opaque-top {
background-image: image(green), image(red);
}
/* image(transparent) on top lets the lower image(green) layer show through. */
.transparent-top {
background-image: image(transparent), image(green);
}
</style>
<p>Test passes if there are two green squares below.</p>
<div class="opaque-top"></div>
<div class="transparent-top"></div>