-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfancy-rounded-corners.html
83 lines (74 loc) · 2.2 KB
/
fancy-rounded-corners.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fancy Rounded Corners</title>
<style>
body {
padding: 1rem;
}
.container {
position: relative;
width: 300px;
height: 200px;
margin-bottom: 2rem;
}
.img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 12px;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
background-color: white;
padding: 0.6rem 1rem;
font-family: monospace;
font-weight: bold;
border-top-right-radius: 12px;
}
.corner {
position: absolute;
width: 12px;
height: 12px;
}
.corner-top {
top: -12px;
left: 0;
}
.corner-right {
bottom: 0;
right: -12px;
}
</style>
</head>
<body>
<div class="container">
<img src="https://picsum.photos/300/200" class="img">
<div class="overlay">
NEWS
<svg class="corner corner-top" viewBox="0 0 7 7" xmlns="http://www.w3.org/2000/svg">
<path d="M 0 7 L 0 0 A 7 7 0 0 0 7 7 L 0 7 Z" fill="white" />
</svg>
<svg class="corner corner-right" viewBox="0 0 7 7" xmlns="http://www.w3.org/2000/svg">
<path d="M 0 7 L 0 0 A 7 7 0 0 0 7 7 L 0 7 Z" fill="white" />
</svg>
</div>
</div>
<div class="container">
<img src="https://placebear.com/300/200" class="img">
<div class="overlay">
NEWS
<svg class="corner corner-top" viewBox="0 0 7 7" xmlns="http://www.w3.org/2000/svg">
<path d="M 0 7 L 0 0 A 7 7 0 0 0 7 7 L 0 7 Z" fill="white" />
</svg>
<svg class="corner corner-right" viewBox="0 0 7 7" xmlns="http://www.w3.org/2000/svg">
<path d="M 0 7 L 0 0 A 7 7 0 0 0 7 7 L 0 7 Z" fill="white" />
</svg>
</div>
</div>
</body>
</html>