I saw this and wondered if it would be possible to merge two images with only CSS.
Isthereanywaytocontrolthispartialtransparencyofoneimageoveranother,orofanimageoverabackgroundortext?
Itriedwithopacity
,butitdidnotevencomeclosetothedesiredeffect,becauseitdoesnothavethe"merge" of one image merging in the other.
body {
margin: 0;
padding: 0;
}
main {
position: relative;
}
.bg1,
.bg2 {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-size: cover;
background-repeat: none;
background-position: center;
}
.bg1 {
background-image: url(https://unsplash.it/600x400/?image=881);
}
.bg2 {
background-image: url(https://unsplash.it/600x400/?image=902);
opacity: .5;
}
<main>
<div class="bg1"></div>
<div class="bg2"></div>
</main>