Harly Dakay
Harly Dakay

Reputation: 67

How to disable collapse in bootstrap

I got a downloaded template for my landing page and I have edited it a bit. I want to disable the transparent background in the navigation tag.

What`s happening in the navigation tag is, the background of the navigation tag is transparent and when you scroll down it becomes black. What I want is to permanently black the background of the navigation tag.

Here is the HTML.

<nav class="navbar navbar-expand-lg navbar-dark fixed-top" id="mainNav">
  <div class="container">
    <a class="navbar-brand js-scroll-trigger" href="#page-top">AyahPH</a>
    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
      Menu
      <i class="fa fa-bars"></i>
    </button>

And the included script.

<script src="../assets/vendor/jquery/jquery.min.js"></script>
<script src="../assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Plugin JavaScript -->
<script src="../assets/vendor/jquery-easing/jquery.easing.min.js"></script>

<!-- Contact form JavaScript -->
<script src="../assets/js/jqBootstrapValidation.js"></script>

I have tried editing the CSS but nothing seems to work. I do not know where I should edit

Upvotes: 0

Views: 3631

Answers (1)

Shubham Sharma
Shubham Sharma

Reputation: 623

Replace your navbar code with below nav bar code

<nav class="navbar navbar-dark bg-dark fixed-top" id="mainNav">
<div class="container">
    <a class="navbar-brand js-scroll-trigger" href="#page-top">AyahPH</a>
    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
      Menu
      <i class="fa fa-bars"></i>
    </button>

Upvotes: 1

Related Questions