我想将元素的背景颜色与父元素的背景图像混合。将 css 属性“background-blend-mode”设置为“multiply”时,它仅在颜色和图像设置在同一元素上时才有效。但我想存档在同一背景图像上混合的不同颜色 - 所以我必须将背景图像与儿童的颜色混合。有没有办法到达那里?
.bg {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TtSIVBzuIOGSoThb8KOKoVShChVArtOpgcumH0KQhSXFxFFwLDn4sVh1cnHV1cBUEwQ8QF1cnRRcp8X9JoUWMB8f9eHfvcfcOEOplplkdY4Cm22Y6mRCzuRUx9IouRBBGHOMys4xZSUrBd3zdI8DXuxjP8j/35+hV8xYDAiLxDDNMm3ideGrTNjjvE0dYSVaJz4lHTbog8SPXFY/fOBddFnhmxMyk54gjxGKxjZU2ZiVTI44TR1VNp3wh67HKeYuzVq6y5j35C8N5fXmJ6zSHkMQCFiFBhIIqNlCGjRitOikW0rSf8PEPun6JXAq5NsDIMY8KNMiuH/wPfndrFSYnvKRwAuh8cZyPYSC0CzRqjvN97DiNEyD4DFzpLX+lDkx/kl5radEjoG8buLhuacoecLkDDDwZsim7UpCmUCgA72f0TTmg/xboWfV6a+7j9AHIUFepG+DgEBgpUvaaz7u723v790yzvx/Ct3LHCx725AAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAGxJREFUaN7t1bEJwDAMBVE5ZBLtv5K8itKatC4Sw/udUHVwcKOqOpZl5nrGnDP+/L/i8AH4eqO7+yTn338KAdjcfZrzOgBAB3QAgA5QCIAOUAiADlAIgA5QCIAOUAiADlAIgA5QCIAOUAjA1h7zMO7kJjvXlwAAAABJRU5ErkJggg==);
}
.mixit-green {
background-color: #ddffdd;
background-blend-mode: multiply;
padding: 50px;
}
.mixit-blue {
background-color: #ddddff;
background-blend-mode: multiply;
padding: 50px;
}
<div class="bg">
<div class="mixit-green"></div>
<div class="mixit-blue"></div>
</div>