Enigmatic marking hovering over sunken navigation bar

My navbar is functioning perfectly, but there is a mysterious black line below the burger icon when the menu collapses. Any suggestions on how to remove this unwanted styling would be greatly appreciated.

https://i.sstatic.net/CelqJ.png

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>HOW WE CAN HELP</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/css/stylesheet.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style>
      .navbar {
        margin-bottom: 0;
        border-radius: 0;
        background-color: transparent; /* need to choose company colors etc. */
        color: #fff;
        padding: 0% 0;
        border: 0;
        border-color: #fff;
      }
      .navbar-brand {
        float: left;
        min-height: 55px;
        padding: 0px 3px 10px 4px;
      }
      .navbar-inverse .navbar-nav .active a, 
      .navbar-inverse .navbar-nav .active a:focus, 
      .navbar-inverse .navbar-nav .active a:hover {
        color: #fff;
        background: #fb4f14;
      }
      /* when hovering over the nav items the colour changes to off whiate #d5d5dd */
      .navbar-inverse .navbar-nav li a {
        color: #fff;
      }
      /*
      .navbar.navbar-default .navbar-collapse {
      border: none;
      box-shadow: none;
      background-color: #fb4f14;
      }
      */
    </style>
  </head>
  <body>
    <head>
      <!-- navigation bar starts here -->
      <nav class="navbar navbar-inverse">
        <div class="container-fluid">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#MyNavbar">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/index.html"><img height="130%" src="/img/logo-placeholder.png"></a>
          </div>
          <div class="collapse navbar-collapse" id="MyNavbar">
            <ul class="nav navbar-nav navbar-right">
              <li><a href="/index.html">Item 1</a></li>
              <li class="active"><a href="/pages/help.html">Item 2</a></li>
              <li><a href="#">Item 3</a></li>
            </ul>
          </div>
        </div>
      </nav>
    </head>
  </body>
</html>

The above snippet of HTML and CSS showcases my issue with the styled black line. Does anyone have any insights on how to resolve this problem?

Answer №1

Using the .navbar-inverse class will give your navbar a dark color scheme by default. For more information on how to create an inverse nav bar, check out the link provided below:

Link: Creating an Inverse Nav Bar with Background Color

The issue here seems to be that you are trying to use the inverse nav without specifying a background color as demonstrated in this link.

To achieve your desired navigation background color of #fb4f14, try using the following code snippet instead of using navbar-inverse:

<nav class="navbar navbar-light" style="background-color: #fb4f14;">
  <!-- Navbar content -->
</nav>

If you want a custom background color for your navbar, it's recommended to avoid using navbar-inverse and opt for a different type of navbar.

The reason you're seeing a black line is because when no background color is specified for the inverse navbar, the default dark black color is applied. Below are examples showcasing the use of the inverse nav:

<nav class="navbar navbar-inverse "> <!-- default dark black line --->
  <!-- Navbar content -->
</nav>

<nav class="navbar navbar-inverse bg-primary"> <!-- primary color matched border line --->
  <!-- Navbar content -->
</nav>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to retrieve data from divs that are nested within another element using Javascript?

I am currently working on implementing a modal that will showcase specific information based on the event-card it originates from. Here is an HTML snippet showcasing an example event-card: <div class="event-card upcoming hackathon"> <d ...

media queries may not function consistently across various websites

Below is the CSS code snippet: @media (max-width:600) { body{ background-color:red; } } p{ color:blue; } The issue I am facing is that the @media section is not functioning properly. I have tested it on multiple devices, including a PC, and ...

Difficulty in displaying JavaScript function output as text

I'm currently developing a program that randomly selects and prints a function from an array list. I am facing difficulties in getting the result to print correctly. Below is the snippet of code: const hiddenElements = document.querySelectorAll( &qu ...

Modify the appearance of an image by hovering over the ::after element for image styling

My design involves a main image with a smaller arrow image overlaid on top, achieved using a pseudo after-element. Currently, when I hover over the main image, the opacity changes as intended. However, the issue arises when hovering over the arrow image o ...

Using JQuery to toggle image visibility, starting with the first image and scrolling through until only one image remains visible

I am facing a challenge where I am unable to modify the HTML code. The current structure is as follows: <div class="slider"> <div class="slider-control"> <button id="prev">Previous</button> ...

Issue occurred while trying to update the MySQL database with an HTML form and Ajax integration

I am facing an issue with my form that uses a drop-down box and a hidden form field to send information to a PHP page. Everything works as expected when I submit the form directly to the PHP page, but when I try using AJAX to pass the information, it doesn ...

Instant Pay Now Option for Your WordPress Website with PayFast Integration

I have encountered an interesting challenge that I would like some guidance on. My goal is to integrate a PayFast "Pay Now" button into a Wordpress.com blog, specifically within a sidebar text widget. The tricky part is that I need the customer to input th ...

Import necessary styles into the shadow DOM

Embracing the concept of shadow dom styles encapsulation is exciting, but I wish to incorporate base styles into each shadow dom as well (reset, typography, etc). <head> <link rel="stylesheet" href="core.css"> ... </h ...

A vertical scroll bar should be created specifically for a div within a dialog box in

I am working on a jQuery dialog that contains three divs. I want the middle div to have a vertical scroll bar when its content exceeds its height. The first div (top) should remain fixed at the top of the dialog box, and the third div (lower) should stay f ...

What is the process for adding elements to an object in Angular JS?

My goal is to send data to an ng-object after filling out and submitting an HTML form with user-defined values. However, after pressing submit, the values are being duplicated. I have attempted to clear the data by using $scope.user > $scope.user=&apos ...

Organize table information using rowspan functionality

View of Current Table I am looking to implement a side column in my table using rowspan to group dates within each pay period. The goal is for a supervisor to be able to create a new pay period, which will assign a unique integer in the database and then ...

What is the best way to display the JSON array received from Postman on my HTML page using jQuery's Ajax success function?

I need help in iterating through the JSON array that is fetched from my API [{"a":1},{"b":2},{"c":3},{"d":4}]. How can I extract and display only the key-value pairs on my HTML output div? <body> <div id = "result" style = "color:green" > ...

Preserve the timestamp of when the radio query was chosen

I'm interested in finding a way to save the user's selected answer for a radio button question and track the time they saved it. Is there a way to achieve this using HTML alone? Or would I need to utilize another coding language or package? Just ...

How to keep the bottom of a CSS {position:sticky; top:0} element within the viewport without using JavaScript

I am working on creating a dashboard frame using Bootstrap 5, and I aim to achieve the functionality shown in these two images: Here is my current setup: <html> <body> <div class="pretoolbar">pretoolbar (non-essential inf ...

Is there a way to have a single background image fill the entire screen?

Can someone help me with my Offcanvas navbar created using Bootstrap? I added a background image from Google as the URL, but instead of one whole piece, it's appearing as 6 duplicate images. What could be the issue here? I tried looking for solutions ...

Using a PHP variable to dynamically change the style sheet by connecting to a MySQL database

My goal is to have the stylesheet URLs stored in a database and be able to change the stylesheets' href using variables in HTML tags. However, when I tried the following code, nothing happened: global $theme_addresss; global $showdetail_dbtadbiruse ...

What is the actual purpose of the <header> and <footer> elements in web design?

Why are headers and footers important on a webpage? Considering that they appear in the order they are written on the page, as shown here, what distinguishes a header from a footer? <article> <footer>This is a footer</footer> &l ...

Verifying the angular form without the need for a submit button

I'm currently utilizing angular.js form validation and I'm looking to implement validation without the use of a form submit button. Below is my HTML code: <form name="userForm"> <input type="hidden" ng-model="StandardID" /> < ...

Handling image errors in jQuery for responsive design queries

Images on my website change based on the screen size using media queries. I am looking for a way to handle errors that may occur using jQuery. I want to display a text message if the image fails to load. Here is the code I have so far: <div class="con ...

Utilizing Bootstrap to set a dynamic background image that spans the entire width of a table

The background image on my About page is not displaying correctly. The first < div > in my container shows it as intended, but the second < div > has white bars on the sides of the table. As a newcomer to Bootstrap and HTML, I hesitated to see ...