I noticed some weird mix-blend-mode
behaviour, see here:
body {
background: blue;
}
main {
width: 2rem;
height: 10rem;
background: blue;
}
div {
position: absolute;
width: 5rem;
height: 5rem;
mix-blend-mode: screen;
}
div:nth-child(1) {
background: red;
}
div:nth-child(2) {
top: 2rem;
background: green;
}
<main>
<div></div>
<div></div>
</main>
Now the div
s don't blend with the body
, only with each other and with main
. But when I set the height of main
to 100vh
, suddenly the div
s blend with the body
. Is this a bug in Chrome?
Here is how it looks in my browser with the code above:
And here with height: 100vh
(note that the width is unchanged):
Even when the main
has no background at all its height changes the mix-blend-mode
between the div
and the body
!
Anyway, I'd like to have div
s in some container so they only blend with each other, not with the container background. Is this possibly, across browsers?