how do you make a header mobile responsive?

Here you can simply use bootstrap to make it responsive. Following is the code for adding the bootstrap.

You simply need to add the link and scripts in your head.



<link rel="stylesheet" href=""
    integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src=""
<script src="[email protected]/dist/umd/popper.min.js"
<script src=""


Code for Responsive Header:

<div class="logo-container row">
    <img src="./img/logo.svg" class="col-6" alt="logo" />
    <h4 class="logo col-6">CVaS</h4>

And now the code for Responsive Navbar:

<nav class="navbar navbar-expand-lg navbar-light bg-light">
 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
  <span class="navbar-toggler-icon"></span>
 <div class="collapse navbar-collapse" id="navbarTogglerDemo01">
  <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
    <li class="nav-item active">
      <a class="nav-link" href="#">Link-1</a>
    <li class="nav-item">
      <a class="nav-link" href="#">Link-2</a>
    <li class="nav-item">
      <a class="nav-link" href="#">Link-3</a>

Note: You won’t need to add css style after this most likely.

If you don’t want to use bootstrap then you can simply use media queries in css for different widths. You can make it responsive using position property in css along with media query.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top