-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathul.html
124 lines (110 loc) · 2.36 KB
/
ul.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test</title>
<style>
body {
margin:0;
padding:0;
font-family: Helvetica, Arial, sans-serif;
font-size: 1em;
background:#eee;
color:#222;
}
/*Style for the first level menu bar*/
ul#menu{
width:100%;
height:2em;
margin:0;
padding:0 10px;
background:#333;
color:#eee;
}
ul#menu > li{
}
label{
position:relative;
display:block;
padding:0 18px 0 12px;
line-height:3em;
transition:background 0.3s;
cursor:pointer;
}
label:after{
content:"";
position:absolute;
display:block;
top:50%;
right:5px;
width:0;
height:0;
border-top:4px solid rgba(255,255,255,.5);
border-bottom:0 solid rgba(255,255,255,.5);
border-left:4px solid transparent;
border-right:4px solid transparent;
transition:border-bottom .1s, border-top .1s .1s;
}
label:hover,
input:checked ~ label{background:rgba(0,0,0,.3);}
input:checked ~ label:after{
border-top:0 solid rgba(255,255,255,.5);
border-bottom:4px solid rgba(255,255,255,.5);
transition:border-top .1s, border-bottom .1s .1s;
}
/*hide the inputs*/
input{display:none}
/*show the second levele menu of the selected voice*/
input:checked ~ ul.submenu{
max-height:300px;
transition:max-height 0.5s ease-in;
}
/*style for the second level menu*/
ul.submenu{
max-height:0;
padding:0;
overflow:hidden;
list-style-type:none;
background:#444;
box-shadow:0 0 1px rgba(0,0,0,.3);
transition:max-height 0.5s ease-out;
position:absolute;
min-width:100%;
}
ul.submenu li a{
display:block;
padding:12px;
color:#ddd;
text-decoration:none;
box-shadow:0 -1px rgba(0,0,0,.5) inset;
transition:background .3s;
white-space:nowrap;
}
ul.submenu li a:hover{
background:rgba(0,0,0,.3);
}
</style>
</head>
<body>
<ul id="menu">
<li>
<input id="check01" type="checkbox" name="menu"/>
<label for="check01">Tasto menu 01</label>
<ul class="submenu">
<li><a href="#">Sotto menu 1</a></li>
<li><a href="#">Sotto menu 2</a></li>
</ul>
</li>
<li>
<input id="check02" type="checkbox" name="menu"/>
<label for="check02">Tasto menu 02</label>
<ul class="submenu">
<li><a href="#">Sotto menu 3 (long text)</a></li>
<li><a href="#">Sotto menu 4</a></li>
<li><a href="#">Sotto menu 5</a></li>
</ul>
</li>
</ul>
</body>
</html>