blob: 74d669e1aa3fbf3f17b0cd673ff2195d0aae5fef [file] [log] [blame]
<!DOCTYPE html>
<head>
<style>
.composited {
/* Not using will-change:transform because it ignores subpixel accumulation. */
will-change: opacity;
}
.box {
width: 100px;
height: 100.5px;
}
.behind {
position: absolute;
z-index: 1;
top: 100px;
left: 100px;
background-color: blue;
}
.middle {
position: absolute;
z-index: 1;
top: 15px;
left: 15px;
background-color: lime;
}
.middle2 {
position: absolute;
z-index: 1;
top: 130.5px;
left: 60px;
background-color: magenta;
}
.top {
position: absolute;
z-index: 1;
top: 70.5px;
left: 120px;
background-color: cyan;
}
.container {
position: absolute;
z-index: 1;
top: 25.5px;
left: 25px;
width: 300px;
height: 300px;
background-color: gray;
}
div:hover {
background-color: green;
}
</style>
</head>
<body>
<div class="container">
<div class="composited box behind"></div>
<div class="box middle"></div>
</div>
<div class="box middle2"></div>
<div class="box top"></div>
</body>