-
Notifications
You must be signed in to change notification settings - Fork 14
/
borders_border-radius-simple-percentage.html
executable file
·65 lines (60 loc) · 1.78 KB
/
borders_border-radius-simple-percentage.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>How percentage border radii are calculated</title>
<style type="text/css">
body {display: flex; justify-content: center;}
.arena p {font-size: 3em; border: 0.1em solid black; padding: 2em;
box-sizing: border-box;
border-radius: 33%;
width: 14.4em;
height: 5.4em;
position: relative;
background-color: silver; background-clip: content-box;}
.arena p b {position: absolute;
width: calc(14.4em*0.33);
height: calc(5.4em*0.33);
border: 0.1em solid rgba(255,192,0,0.5);
background-image:
radial-gradient(circle at center, transparent 3.5em),
linear-gradient(to left, black, black);
background-repeat: no-repeat;
background-size: 100% 100%, 50% 1px;
display: flex;
align-items: center;
filter:
drop-shadow(0 0 1px white)
drop-shadow(0 0 1px white)
drop-shadow(0 0 2px white)
drop-shadow(0 0 3px white)
;
}
.arena p b.top {top: -0.1em; border-bottom-width: 0;}
.arena p b.bottom {bottom: -0.1em; border-top-width: 0;}
.arena p b.right {right: -0.1em; border-left-width: 0;
background-position: center, center right;
justify-content: end;
}
.arena p b.left {left: -0.1em; border-right-width: 0;
background-position: center, center left;
justify-content: start;
}
.arena p b i { font: 0.5em Arvo, serif; position: absolute;
background: white; margin: 0; font-style: normal;}
.arena p b.top.left i:nth-child(1) {top: -1ch; left: 15%;}
.arena p b.top.left i:nth-child(2) {left: -2ch; top: 1ch;}
.arena p b.bottom.right i:nth-child(1) {bottom: -1ch; right: 15%;}
.arena p b.bottom.right i:nth-child(2) {right: -2ch; bottom: 1ch;}
</style>
</head>
<body>
<section class="arena">
<p>
My borders are rounded.
<b class="top left"><i>33%</i><i>33%</i></b>
<b class="bottom right"><i>33%</i><i>33%</i></b>
</p>
</section>
</body>
</html>