forked from SheepTester/words-go-here
-
Notifications
You must be signed in to change notification settings - Fork 0
/
radio.css
56 lines (49 loc) · 1.13 KB
/
radio.css
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
/* ========== Radio Buttons from W3School ========== */
/* The container */
.container {
display: block;
position: relative;
padding-left: 30px;
margin-bottom: 6px;
cursor: pointer;
}
/* Hide the browser's default radio button */
.container input[type="radio"] {
position: absolute;
opacity: 0;
cursor: pointer;
}
/* Create a custom radio button */
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 17px;
width: 17px;
background-color: transparent;
border: 1px solid white;
border-radius: 50%;
}
/* On mouse-over, add a grey background color */
.container:hover input~.checkmark {
background-color: rgba(255,255,255,0.4);
}
/* Create the indicator (the dot/circle - hidden when not checked) */
.checkmark:after {
content: "";
position: absolute;
display: none;
}
/* Show the indicator (dot/circle) when checked */
.container input:checked~.checkmark:after {
display: block;
}
/* Style the indicator (dot/circle) */
.container .checkmark:after {
top: 5px;
left: 5px;
width: 7px;
height: 7px;
border-radius: 50%;
background: white;
}