- <style>
- .img-right{
- position: absolute;
- right: 0;
- top: 0;
- background: blue;
- background-size: cover;
- -webkit-mask-image: -webkit-linear-gradient(left top, transparent 50%, white 50%);
- width: 100%;
- height: 100%;
- }
- .img-container{
- position: relative;
- width: 400px;
- height: 200px;
- border: 5px solid #40BCFF;
- }
- .img-left{
- background: red;
- background-size: cover;
- width: 100%;
- height: 200px;
- }
- </style>
- <div class="img-container">
- <div class="img-left"></div>
- <div class="img-right"></div>
- </div>
来源: http://www.codesnippet.cn/detail/1206201614728.html