を使用しmix-blend-mode
ます。
デモ:
http://plnkr.co/edit/R5TBohMs1jKfsPj7zcXt?p=preview
ブレンドモードを使用するには、次の 2 つの方法があります。
background-blend-mode
: 両方の背景が同じ div にある場合、このプロパティを使用できます。
mix-blend-mode
: 2 つの異なる要素の背景をブレンドする場合は、プロパティを使用できmix-blend-mode
ます。
コード:
HTML:
<div class="wrapper">
<div class="first"></div>
<div class="second"></div>
</div>
CSS:
div.wrapper {
position: relative;
}
div.first,
div.second {
width: 300px;
height: 200px;
position: absolute;
}
div.first {
background: url(http://images.all-free-download.com/images/graphicthumb/male_lion_193754.jpg) 0 0 no-repeat;
z-index: 9;
top: 0px;
left: 0px;
}
div.second {
background: url(http://images.all-free-download.com/images/graphicthumb/canford_school_drive_dorset_514492.jpg) 0 0 no-repeat;
z-index: 10;
mix-blend-mode: difference;
top: 30px;
left: 120px;
}