Files
  • index.html
  • logo_transparent.png
  • script.js
  • style.css
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
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Responsive navbar</title>

    <!-- Font-awesome -->
    <link
      rel="stylesheet"
      href="https://use.fontawesome.com/releases/v5.7.0/css/all.css"
      integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ"
      crossorigin="anonymous"
    />

    <!-- jQuery -->
    <script
      src="https://code.jquery.com/jquery-3.3.1.min.js"
      integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
      crossorigin="anonymous"
    ></script>

    <!-- Styling -->
    <link rel="stylesheet" href="style.css" />

    <!-- Script -->
    <script src="script.js"></script>
  </head>

  <body>
    <!-- Navbar section -->
    <nav class="top_nav">
      <logo> <img src="logo_transparent.png" alt="" height="45px" /> </logo>

      <button id="hamburger"><i class="fas fa-bars"></i></button>

      <ul id="nav_links">
        <li><a href="">Home</a></li>
        <li><a href="">Blog</a></li>
        <li><a href="">Videos</a></li>
        <li><a href="">About us</a></li>
        <li><a href="">Contact</a></li>
      </ul>

      <div id="search_bar">
        <input type="search" placeholder="search..." />
        <button><i class="fas fa-search"></i></button>
      </div>
    </nav>
  </body>
</html>
result
console