效果如下:
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>图片剪切</title>
<style type="text/css">
body{
margin: 0;
padding: 0;
background:pink ;
}
.box{
top: 100px;
left: 200px;
width: 500px;
height:350px;
position: absolute;
/*background: dodgerblue;*/
}
.img1{
opacity: 0.5;
}
img{
width: 500px;
height:350px;
position: absolute;
z-index: 1;
}
.img2{
clip: rect(0px,300px,3