-
Notifications
You must be signed in to change notification settings - Fork 0
/
usingcheckbox.html
170 lines (150 loc) · 3.03 KB
/
usingcheckbox.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>using check box</title>
<style type="text/css">
*{
margin: 0px;
padding: 0px;
list-style: none;
text-decoration: none;
letter-spacing: 3px;
text-transform: uppercase;
box-sizing: border-box;
}
.body{
width: 100%;
height: 100%;
background: grey;
position: fixed;
}
.body .menu{
width: 100%;
height: 20%;
position: relative;
background: lightblue;
display: flex;
}
.body .menu ul{
display: flex;
line-height:20vh;
left: 50px;
position: relative;
}
.body .menu ul li{
padding-left: 5px;
}
.body .content {
text-align: center;
position: relative;
top: 100px;
}
#one{
display: none;
cursor: pointer;
}
#two{
display: none;
cursor: pointer;
}
#three{
display: none;
cursor: pointer;
}
#four{
display: none;
cursor: pointer;
}
.body .menu ul li{
cursor: pointer;
}
.body .content #me1{
display: none;
}
.body .content #me2{
display: none;
}
.body .content #me3{
display: none;
}
.body .content #me4{
display: none;
}
/*first is blocked other none*/
#one:checked~.content #me1{
display: block;
}
#one:checked~.content #me2{
display: none;
}
#one:checked~.content #me3{
display: none;
}
#one:checked~.content #me4{
display: none;
}
/*second is blocked other none*/
#two:checked~.content #me2{
display: block;
}
#two:checked~.content #me1{
display: none;
}
#two:checked~.content #me3{
display: none;
}
#two:checked~.content #me4{
display: none;
}
/*third is blocked other none*/
#three:checked~.content #me3{
display: block;
}
#three:checked~.content #me1{
display: none;
}
#three:checked~.content #me2{
display: none;
}
#three:checked~.content #me4{
display: none;
}
/*fourth is blocked other none*/
#four:checked~.content #me4{
display: block;
}
#four:checked~.content #me1{
display: none;
}
#four:checked~.content #me2{
display: none;
}
#four:checked~.content #me3{
display: none;
}
</style>
</head>
<body>
<div class="body">
<input type="radio" id="one" name="radio1">
<input type="radio" id="two" name="radio1">
<input type="radio" id="three" name="radio1">
<input type="radio" id="four" name="radio1">
<div class="menu">
<ul>
<label for="one" class="m1"><li id="menu1" style="color: red;">hit me1!</li></label>
<label for="two" class="m2"><li id="menu2" style="color: green;">hit me2!</li></label>
<label for="three" class="m3"><li id="menu3" style="color: blue;">hit me3!</li></label>
<label for="four" class="m4"><li id="menu4" style="color: palevioletred;">hit me4!</li></label>
</ul>
</div>
<div class="content">
<div id="me1" style="color: red;">menu1_content</div>
<div id="me2" style="color: green;">menu2_content</div>
<div id="me3" style="color: blue;">menu3_content</div>
<div id="me4" style="color: palevioletred;">menu4_content</div>
</div>
</div>
</body>
</html>