-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
56 lines (52 loc) · 1.25 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<style type="text/css">
input[type="radio"] {
opacity: 0;
width: 0;
height: 0;
}
.radio-box {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
-webkit-box-sizing: border-box;
box-sizing: border-box;
list-style: none;
display: block;
position: relative;
margin-right: 8px;
cursor: pointer;
transition: all .3s ease;
}
.radio-style::before {
display: inline-block;
width: 18px;
height: 18px;
border-radius: 50%;
border: 1px solid #d9d9d9;
-webkit-box-sizing: border-box;
box-sizing: border-box;
content: "";
}
input[type="radio"]:checked + .radio-style::before {
padding: 4px;
background-color: blue;
background-clip: content-box;
border-color: blue;
}
</style>
<label for="cat" class="radio-box">
<input type="radio" name="group" id="cat">
<span class="radio-style">猫</span>
</label>
<label for="dog" class="radio-box">
<input type="radio" name="group" id="dog">
<span class="radio-style">狗</span>
</label>
</body>
</html>