html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Navbar</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<nav class="navbar">
<div class="left">
<h1>Navbar</h1>
</div>
<div class="right">
<input type="checkbox" id="check">
<label for="check" class="checkBtn">
<i class="fa fa-bars"></i>
</label>
<ul class="list">
<li><a href="#">Home</a></li>
<li><a href="#">Gallery</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">About Us</a></li>
Enter to Rename, Shift+Enter to Preview
css
css
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
* {
margin: 0;
padding: 0;
box-sizing: border-box;
color: white;
font-family: 'Ubuntu', sans-serif;
}
.navbar {
background-color: rgb(22, 7, 36);
display: flex;
justify-content: space-around;
align-items: center;
line-height: 5rem;
}
.left h1 {
font-size: 2.5rem;
cursor: pointer;
}
.checkBtn {
display: none;
}
#check {
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
alert ("hello!, dear🥰")
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run