-
Notifications
You must be signed in to change notification settings - Fork 0
/
chamfer.html
62 lines (55 loc) · 2.01 KB
/
chamfer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>chamfer</title>
</head>
<body>
<div class="box"></div>
<div class="box1"></div>
</body>
<style>
/*斜切角*/
.box{
width: 200px;
height: 100px;
/*linear-gradient*/
/*background: #58a;*/
/*background: linear-gradient(135deg, transparent 15px, #58a 0) top left,*/
/*linear-gradient(-135deg, transparent 15px, #58a 0) top right,*/
/*linear-gradient(-45deg, transparent 15px, #58a 0) bottom right,*/
/*linear-gradient(45deg, transparent 15px, #58a 0) bottom left;*/
/*background-size: 50% 50%;*/
/*background-repeat: no-repeat;*/
/*svg*/
/*border: 20px solid transparent;*/
/*border-image: 1 url('data:image/svg+xml,\<svg xmlns="http://www.w3.org/2000/svg"\ width="3" height="3" fill="%2358a">\<polygon points="0,1 1,0 2,0 3,1 3,2 2,3 1,3 0,2"/>\</svg>');*/
/*background: #58a;*/
/*background-clip: padding-box;*/
/*clip-path*/
background: #58a;
-webkit-clip-path: polygon( 20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px);
clip-path: polygon( 20px 0, calc(100% - 20px) 0, 100% 20px,
100% calc(100% - 20px), calc(100% - 20px) 100%,
20px 100%, 0 calc(100% - 20px), 0 20px
);
}
/*曲线切角*/
.box1{
width: 200px;
height: 100px;
margin-top: 100px;
background: #58a;
background: radial-gradient(circle at top left,
transparent 15px, #58a 0) top left,
radial-gradient(circle at top right,
transparent 15px, #58a 0) top right,
radial-gradient(circle at bottom right,
transparent 15px, #58a 0) bottom right,
radial-gradient(circle at bottom left,
transparent 15px, #58a 0) bottom left;
background-size: 50% 50%;
background-repeat: no-repeat;
}
</style>
</html>