-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathside_menu.html
More file actions
82 lines (72 loc) · 1.8 KB
/
Copy pathside_menu.html
File metadata and controls
82 lines (72 loc) · 1.8 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Side Menu</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: "Lato", sans-serif;
}
.sidebar {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #b62828;
overflow-x: hidden;
transition: 0.5s;
padding-top: 60px;
}
.sidebar a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
transition: 0.3s;
}
.sidebar a:hover {
color: #f1f1f1;
}
.sidebar .closeButton {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}
@media screen and (max-height: 450px) {
.sidebar {
padding-top: 15px;
}
.sidebar a {
font-size: 18px;
}
}
</style>
</head>
<body>
<div id="sideMenu" class="sidebar">
<a href="javascript:void(0)" class="closeButton" onclick="closeMenu()">×</a>
<a href="#">Home</a>
<a href="#">Portfolio</a>
<a href="#">Blog</a>
<a href="#">Contact</a>
</div>
<center>
<h2> Side Menu</h2>
<p>Click the icon below to open the side menu</p>
</center>
<span style="font-size:30px;cursor:pointer" onclick="openMenu()">☰ Open Menu</span>
<script>
function openMenu() {
document.getElementById("sideMenu").style.width = "250px";
}
function closeMenu() {
document.getElementById("sideMenu").style.width = "0";
}
</script>
</body>
</html>