forked from wesbos/hot-tips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
border-radius.html
57 lines (43 loc) · 939 Bytes
/
border-radius.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<header>
<div class="card-outer">
<img src="https://pbs.twimg.com/profile_images/879361767914262528/HdRauDM-_400x400.jpg" class="card-inner">
</div>
</header>
<style>
.card-outer {
--radius: 20px;
--border: 5px;
/* Outer = Inner + Space Between */
border-radius: calc(var(--radius) + var(--border));
}
.card-inner {
margin: var(--border);
border-radius: var(--radius);
}
body {
background: black;
}
header {
background: #e3120b;
text-align: center;
}
.card-outer {
display: inline-block;
translate: 0 50%;
overflow: hidden;
background: black;
}
img {
width: 200px;
}
</style>
</body>
</html>