clip:
使用场景:可裁剪长方形,圆形,扇形等。
参数:rect(top,right,bottom,left)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
.father {
background: yellow;
width: 200px;
height: 200px;
}
.son {
width: 100px;
height: 100px;
border-radius: 50%;
background-color: aliceblue;
position: absolute;
clip: rect(0px 50px 100px 0px);
}
</style>
</head>
<body>
<div class="father">
<div class="son"></div>
</div>
</body>
</html>
网友评论