使用CSS mask实现图片拼接

CSS mask & linear gradient

<div class="img-container">
    <div class="img-left"></div>
    <div class="img-right"></div>
</div>
.img-container{
    position: relative;
    width: 200px;
    height: 200px;
    border: 5px solid #40BCFF;
}
 
.img-left{
    background: url(img/left.jpg);
    background-size: cover;
    width: 100%;
    height: 100px;
}
 
.img-right{
    position: absolute;
    left: 0;
    top: 0;
    background: url(img/right.jpg);
    background-size: cover;
    -webkit-mask-image: -webkit-linear-gradient(left top, transparent 50%, white 50%);
    width: 100%;
    height: 100%;
}