Navbar in Bootstrap 3 is overlapping

Below is the code snippet I am using on my website to implement a menu with Bootstrap 3:

<html>
  <head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
  </head>
  <body>
    <nav class="navbar navbar-default" style="background: rgba(255,255,255,0.5);">
      <div class="container-fluid">
      <div class="navbar-header pull-left">
      <a href="/" class="navbar-left" style="margin-top: 5px;">Title</a>      
      </div>
        <div class="navbar-header pull-right">
        <ul class="nav pull-left">

            <li class="dropdown pull-right">
              <a href="#" data-toggle="dropdown" style="margin-top: 5px;" class="dropdown-toggle btn btn-info"><i class="fas fa-spin text-warning fa-bolt"></i>വിഭാഗങ്ങൾ<b class="caret"></b></a>
              <ul class="dropdown-menu">
              <li><a target="_blank" href="#">test1</a></li>
              <li><a target="_blank" href="#">test1</a></li>
              <li><a target="_blank" href="#">test1</a></li>
              <li><a target="_blank" href="#">test1</a></li>      
              <li><a target="_blank" href="#">test1</a></li>
              <li><a target="_blank" href="#">test1</a></li> 
              <li><a target="_blank" href="#">test1</a></li>
              <li><a target="_blank" href="#">test1</a></li>
              <li><a target="_blank" href="#">test1</a></li>
              <li><a target="_blank" href="#">test1</a></li>         
              </ul>
            </li>
          </ul>
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

        </div>

        <div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">


          <ul class="nav navbar-nav pull-left">

              <li><a target="_blank" class="btn btn-primary" href="#">test1</a></li>
              <li><a target="_blank" href="#">test1</a></li>
              <li><a href="/users/sign_up">Sign up</a></li>
              <li><a href="/users/sign_in">Log in</a></li>

          </ul>
        </div>
      </div>
    </nav>
  </body>
</html>

To see a demonstration of this code, you can click here. However, there seems to be an issue where the revealed content overlaps with the navbar when clicking on the collapsible three lines. I have tried adjusting padding as well as utilizing the classes pull-left and pull-right, but these solutions have not resolved the problem. Can someone help identify the error in my code?

Answer №1

To create some space at the top of the bs-example-navbar-collapse-1, you can apply a margin-top property.

#bs-example-navbar-collapse-1{
  margin-top:50px;
}

You can view the code in action on this fiddle Here

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

The background image is failing to load

Why isn't my background image showing up? Check out the jsFiddle here CSS Styles .arrow_icon { display: block; width: 320px; // 25 height: 240px; // 25 background-image: url(http://s12.postimg.org/yi7yl766z/5b8nbn.jpg); backgrou ...

Creating an uncomplicated selector bar for a basic javascript slideshow

I've spent the last couple of hours teaching myself some basic JavaScript, so please bear with me. Currently, I have a simple code in place for a straightforward slideshow on a website. Here is the JavaScript I'm using (where the 'slide&apo ...

Problem with CSS layout on Internet Explorer 9

I've encountered some layout difficulties in IE9 and I'm struggling to identify the root of the problem. Even though I'm using Foundation 5, I don't believe that's the issue. The content is within a Foundation grid set at large-12 ...

What is the best way to use CSS 3 to resize and enlarge an image, such as sprite icons?

Hello everyone, Picture this: a sprite image named icons.png linked to the css class .icons, featuring various 10x10px graphics. Now imagine needing another class that enlarges these sprite graphics exactly twice their size, making them 20x20 pixels on the ...

I encountered an issue while using WooCommerce where I needed the "color section" product attribute to be hidden or disabled when a customer clicked on "stock" in the product price. Unfortunately, I'm unsure of how

function hideStock(){ var selected = document.getElementById("stk"); var hidden = document.getElementById("pa_color"); if (selected.onchange=="stock") { hidden.style.display = "none"; } } <table class= ...

The footer should remain at the bottom of the page without being permanently fixed

Is there a way to keep the bootstrap footer at the bottom without fixing it in place? In the code example below, the footer should always appear at the bottom. The white space after the footer should come before it. Using sticky-bottom achieves this, but ...

Tips for implementing a sticky sidebar in HTML5 with jQuery

I currently have two files: index.php and aside.php. I've already created the contents of aside.php. Now, I want to make the aside page sticky. To achieve this, I referred to the following link: http://codepen.io/pouretrebelle/pen/yvcBz My struggle ...

What is the best way to conceal text while retaining icons on a compact screen?

How can I hide the text links for Home, Reservations, My Reservations, About, and Settings on smaller screens while still keeping the icons visible? Currently, I am using the following resources: http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.1 ...

Move a CSS div with animation to a specific fixed position

Is there a way to modify this code so that the ball moves to the right and remains in that position? http://codepen.io/chriscoyier/pen/pBCax You can experiment with the live version of the output by clicking on the link above. body { padding: 30px; } # ...

Get rid of the border when the display property is changed to none

I am facing a challenge with removing a border when the display property is set to none, despite it being a seemingly simple task. My understanding has always been that setting the display property to none removes an element from the HTML flow. However, i ...

Separate sentence to one word per line

Can CSS be used to display each word of a sentence on a separate line? Input: <div>Hello world foo bar</div> Rendered output: Hello world foo bar It is not ideal to set the width to 1px, as specified. ...

Achieve a uniform display of flex items with equal spacing between them, regardless of their

I am faced with a situation where I have two identical row-components with the CSS properties display: flex and justify-content: space-between: <div class="component-row"> <div>looooooooooong</div> <div>short</div> < ...

What is causing the npm element to malfunction?

I'm having trouble with the vertical timeline component from an npm package. It seems to be breaking, as you can see in the picture. Additionally, I haven't been able to figure out how to change the color of the vertical line despite reading thro ...

CSS grid challenges on a massive scale

My CSS grid timeline is currently generating around 1300 divs, causing performance issues. Is there a way to style or interact with the empty nodes without rendering all of them? I also want each cell to be clickable and change color on hover. Any suggest ...

Style your Checkbox Button with the Checkbox component from Element Plus

Currently, I am utilizing Vue 3 along with the Element Plus library. My goal is to modify the hover, active, and select colors of the Checkbox Button that I have implemented. Unfortunately, my attempts to do so have not been successful. I essentially copie ...

Ways to position loading animation in the center and create a lightbox effect for the rest of the page

I have implemented a custom loader in CSS with the following styles: .loader { border: 16px solid #f3f3f3; /* Light grey */ border-top: 16px solid #3498db; /* Blue */ border-radius: 50%; width: 80px; height: 80px; animation: spin 2s linear inf ...

Arrange Bootstrap grid elements so that the majority of the content is aligned at the top, while keeping the button positioned

I have a layout using Bootstrap 4 grid to showcase some elements. I want the titles and textual content to be aligned vertically at the top, which is working fine. However, there is a <button> at the end of each grid element that I want to be vertica ...

The significance of Z-index in Embedded Email Subscription Code

I am encountering an issue with a pop-up window I have created for visitors to sign up for our mailing list. The problem is that the CSS menu appears on top of the pop-up, despite setting the menu's z-index to 9999. How can I adjust the z-index in the ...

Exploring the Wilderness: Full-screen Safari Adventure

Currently, I've been working on a website called In the 'Have you seen us' section, there is a full-width block with two columns; the right column features an image while the left displays text content. When viewing on desktop, I set the i ...