-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
111 lines (87 loc) · 2.02 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
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
<!DOCTYPE html>
<html>
<head>
<title>Menu research</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<style>
body {
font-family: sans-serif;
}
.menu-button {
background-color: #333;
color: white;
display: inline-block;
padding: 10px 15px;
}
.menu-button-status, .sub-menu-button-status {
display: none;
}
.sub-menu-button-status:checked ~ .submenu, .menu-button-status:checked ~ .menu {
display: block;
}
.item:hover {
cursor: pointer;
opacity: 0.8;
}
.item:active {
opacity: 1;
}
.menu {
background-color: #333;
color: white;
display: none;
width: 100%;
}
.menu .item {
display: block;
padding: 10px;
line-height: 1;
}
.submenu {
background-color: #e1e1e1;
width: 100%;
display: none;
/*overflow-y: hidden;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;*/
}
.submenu .item {
display: block;
padding: 10px;
line-height: 1;
color: #333;
}
@media screen and (min-width: 800px) {
.menu-button {
display: none;
}
.menu {
display: block;
}
.menu .item {
display: inline-block;
}
}
</style>
<label class="menu-button" for="menu-button-status">+</label>
<input id="menu-button-status" class="menu-button-status" type="checkbox">
<nav class="menu">
<div class="item">menu1</div>
<div class="item">menu2</div>
<label class="item sub-menu-button" for="sub-menu-button-status">news</label>
<input id="sub-menu-button-status" class="sub-menu-button-status" type="checkbox">
<nav class="submenu">
<div class="item">submenu1</div>
<div class="item">submenu2</div>
<div class="item">submenu3</div>
<div class="item">submenu4</div>
<div class="item">submenu5</div>
<div class="item">submenu6</div>
</nav>
</nav>
</body>
</html>