-
Notifications
You must be signed in to change notification settings - Fork 0
/
try.html
210 lines (179 loc) · 3.86 KB
/
try.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html>
<head>
<title>Navigation Menu With CSS</title>
<style>
nav a{
float:right;
text-decoration:none;
color:#002e5b;
font-size:18px;
padding: 25px 35px;
display:inline-block;
transition: all 0.5s ease 0s;
}
#logo{
font-size:20px;
text-transform:uppercase;
color:#002e5b;
font-weight:bold;
float:left;
padding: 20px 20px;
margin-left:17%;
}
header{
overflow:hidden;
background-color:#fde428;
margin-bottom:50px;
}
body{
margin:0px;
padding:0px;
font-family: 'Open Sans', sans-serif;
}
nav{
margin-right:17%;
}
h1{
margin:0px auto;
font-size:26px;
padding:40px 0px;
color:#002e5b;
text-align:center;
}
h1 span{
font-weight:400;
}
section{
width:100%;
max-width:1200px;
margin:0px auto;
}
.content{
margin-bottom:60px;
width:750px;
}
.content h2{
font-size:18px;
font-weight:500;
color:#002e5b;
border-bottom:1px solid #fde428;
padding-bottom:10px;
margin-bottom:10px;
}
.content p{
font-size:14px;
line-height:20px;
color:#7c7c7c;
text-align:justify;
}
nav a:hover{
background-color:#002e5b;
color:#fde428;
transition: all 0.5s ease 0s;
}
@media only screen and (max-width: 1200px) {
#logo{
padding:25px 0px;
}
nav a{
padding: 25px 20px;
}
}
input[type=checkbox], label{
display:none;
}
@media only screen and (max-width: 980px) {
.hamburger-icon{
margin-right:15px;
}
.hamburger-icon div{
width:25px;
height:3px;
margin:3px 0;
background-color:black;
}
label {
float:right;
padding:8px 0px;
display:inline-block;
cursor:pointer;
}
header{
padding:20px 0px;
}
#logo{
padding:0;
}
input[type=checkbox]:checked ~ nav{
display:block;
}
nav {
display:none;
position:absolute;
right:0px;
top:188px;
background-color:#002e5b;
padding:0px;
margin-right:15px;
}
nav a{
float:none;
padding:0px;
color:#FFF;
font-size:15px;
padding:10px 20px;
display:block;
border-bottom: 1px solid rgba(225,225,225,0.1);
}
}
@media only screen and (max-width: 980px) {
.content{width:70%;}
}
@media only screen and (max-width: 568px) {
h1{padding:25px 0px;}
h1 span{display:block;}
}
@media only screen and (max-width: 480px) {
section {max-width: 90%;}
}
@media only screen and (max-width: 360px) {
h1{font-size:20px;}
label{padding:5px 0px;}
#logo{font-size: 20px;}
}
@media only screen and (max-width: 320px) {
h1 {padding: 20px 0px;}
}
</style>
</head>
<body>
<h1><span>Responsive Navigation Menu</span> Using Pure CSS</h1>
<header>
<section>
<div id="logo">OnAirCode</div>
<input type="checkbox" id="toggle">
<label for="toggle" class="hamburger-icon"><div></div><div></div><div></div></label>
<nav>
<a href='#JavaScript'>JavaScript</a>
<a href="#CSS">CSS</a>
<a href="#HTML">HTML</a>
<a href="#logo">Home</a>
</nav>
</section>
</header>
<section id="HTML" class="content">
<h2>HTML</h2>
<p>In this tutorial, we have built an example of responsive navigation menu with HTML and CSS only. Using the andchor tab we have navigated within the page only. But if you prefer you can change the href value to any other external link to navigate to the link. </p>
</section>
<section id="CSS" class="content">
<h2>CSS</h2>
<p>This navigation Menu is a simple example built with Pure CSS and HTML</p>
</section>
<section id="JavaScript" class="content">
<h2>JavaScript</h2>
<p>In this tutorial, we have built an example of responsive navigation menu without using Javascript. We've made use of media queries and changed the CSS on several checkpoint to make it responsive with differnt width.</p>
</section>
</body>
</html>
In this tutorial, we have learnt to develop an example of navigation menu. We've used media queries at several breakpoints to add responsiveness. There are many ways you can develop a navigation menu. Moving on, I suggest you experiment with more designs using JavaScript, icons or more animations.