Expanding Navigation Bar Glitch

I'm facing an unusual bug with my navbar when it expands. It appears to overlap one of the listed elements, specifically the home element.

It would be great if I could find a way to make it expand below the navbar, similar to the example called proper navbar.

Below is the code for my navbar:

<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

<body data-spy="scroll" data-target=".navbar-collapse">

    <div class="navbar navbar-inverse navbar-fixed-top ">
        <div class = "container">
            <div class="navbar-header">

              <a class="navbar-brand" href="#">Møllaren Café</a>
                  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

                    <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">
             <ul class = "nav navbar-nav">
                <li class = "active"><a href="#">Home</a></li>
                <li><a href="#">Meny</a></li>
                <li><a href="#">Om oss</a></li>
                <li><a href="#">Kontakt</a></li>
              </ul>
              </div>
        </div>
    </div>

<body data-spy="scroll" data-target=".navbar-collapse">

    <div class="navbar navbar-inverse navbar-fixed-top ">
        <div class = "container">
            <div class="navbar-header">

              <a class="navbar-brand" href="#">Møllaren Café</a>
                  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

                    <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">
             <ul class = "nav navbar-nav">
                <li class = "active"><a href="#">Home</a></li>
                <li><a href="#">Meny</a></li>
                <li><a href="#">Om oss</a></li>
                <li><a href="#">Kontakt</a></li>
              </ul>
              </div>
        </div>
    </div>

I suspect the issue might be in my font CSS for the logo.

@font-face {
font-family: 'Diploma Regular';
font-style: normal;
font-weight: normal;
src: local('Diploma Regular'), url('Diploma.woff') format('woff');
}

.navbar-brand{
    font-family: 'Diploma Regular';
    font-style: normal;
    font-weight: normal;
    src: local('Diploma Regular'), url('Diploma.woff') format('woff');
}

Screenshot of the Navbar Bug

Example of Proper Navbar

Answer №1

No issues found. See the snippet below, it is working perfectly.

.navbar .navbar-nav li a:hover {
  color: #be1d2c;
  trans ition: color .3s;
}

.navbar-header {
  height: 65px;
  padding-top: 0;
}

.navbar-brand {
  font-size: 2.5em;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<body data-spy="scroll" data-target=".navbar-collapse">

  <div class="navbar navbar-inverse navbar-fixed-top ">
    <div class="container">
      <div class="navbar-header">

        <a class="navbar-brand" href="#">Møllaren Café</a>
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

                    <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">
        <ul class="nav navbar-nav">
          <li class="active"><a href="#">Home</a></li>
          <li><a href="#">Meny</a></li>
          <li><a href="#">Om oss</a></li>
          <li><a href="#">Kontakt</a></li>
        </ul>
      </div>
    </div>
  </div>

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

Tips for implementing unique fonts on a website

I've noticed that some websites use unique fonts. One font in particular caught my eye - it's called MuseoSlab500Regular. How can I incorporate this font into my styles? Do I need to download the font from a specific source to ensure it display ...

"Divs of the same type automatically adjust size to fit within the

I am currently exploring the possibility of creating a versatile component that can be customized based on the needs of its parent element, whether through bootstrap or traditional flexbox / CSS grid. I want to determine the level of reusability this compo ...

Monitoring the modifications of a linked component in React: A guide

I am facing an issue where I need to store the text of a referenced element in an array. My goal is to first display the text of each paragraph element with the "ebookName" class in the console before storing it in the array. However, I have encountered a ...

Implement consistent styling across several elements within a component

const GreenRow = styled.div` background-color: green; ` const RedRow = styled.div` background-color: red; ` const YellowRow = styled.div` background-color: yellow; ` const GreyRow = styled.div` background-color: grey; ` const MyComponent = () => ...

Adjust the text size to fit perfectly within the boundaries of a textarea input field

Is there a way to ensure that users type within a specific area with formatting and returns in a textarea element? I'm looking for a solution that limits overflow and ensures users stay within the designated area. How can this be achieved? I am worki ...

Eliminate repeated entries in a drop-down menu and display them with commas in between

I am working with a list that contains various language combinations: German to English German to Spanish German to Chinese German to French English to Spanish English to French English to Greek English to Portuguese Does anyone have suggestions on how ...

Please input only 0s and 1s into the designated field

How can I modify this code to only accept 0 and 1 in the input field, while also adding spaces after every 4 digits? Currently, it accepts all digits. I'm struggling with creating a pattern that restricts it to just 0 and 1. document.getElementById(&a ...

"Deleting a line from a text file in PHP with a predetermined format: A step-by-step guide

I am facing a situation where I need to manipulate a CSS file through PHP. The CSS file contains the following properties: #firstdiv { width:100%; height:200px; } #seconddiv { width:80%; height:70px; } #thirddiv { width:80%; height:70px; } #firstdiv { col ...

What is the process for creating a default button in Ionic framework?

Recently, I developed an app that includes a survey page. Each question in the survey has two buttons for the user to select: Yes or No. However, as a newcomer to using Ionic, I encountered an issue after building the code and checking the output. One of ...

JavaScript code is failing to render data properly within HTML documents

I am facing an issue while trying to display data extracted from JSON in HTML. Despite my efforts, the data is not showing up on the webpage. I am unsure about what might be causing this error. Any assistance in resolving this matter would be greatly appre ...

Creating a unique-looking visual representation of progress with arcs

Looking to create a circular progress bar (see image below), with loading starting from the left bottom side up to the right bottom side. The empty state should be light-blue (#E8F6FD) and the progress color strong blue (#1CADEB). https://i.sstatic.net/VZ ...

Binding iframes in Angular 6

Is there a way to display iframe code stored in a variable within a div? Here's the HTML code: <div class="top-image" [innerHTML]="yt"></div> And here's the TypeScript code: yt = '<iframe class="w-100" src="https://www.you ...

Transfer a file from the file:///var/mobile/Applications/ directory to an accessible location for reading in Cordova/PhoneGap

I have a unique 'whitelabel' app that customizes itself for each client by downloading image files from a configuration server. However, I am facing an issue where the images are not displayed and instead showing a "Not allowed to load local reso ...

What method does the browser use to select the srcset image for loading when no sizes attribute is included?

My website features an image that is displayed in various sizes depending on the browser dimensions: Since the website is responsive, the image's width can range from 200 to over 1000 pixels, depending on the size of the browser window. We aim to sho ...

Enhance Fullcalendar by incorporating an HTML tag alongside the "titleformat" option

I am utilizing the jQuery Fullcalendar agenda feature. My main objective is to link an action with each date that appears in the calendar and enable the opening of a separate window for each date. Therefore, I am looking to include a button or a link next ...

Managing the attention on a switch button

I'm struggling to maintain focus on the toggle button after it's been clicked. Currently, when I press the button, the focus jumps to the top of the page. I can't figure out what I'm doing wrong. Below is the code snippet: HTML <b ...

Switching images upon hovering in AngularJS

Looking to change images on hover in my Angular app, encountered site peculiarities making CSS solution impractical. Resorted to using ng-mouseenter and ng-mouseleave for image swapping instead. landing.jade img.share-button(src='images/btn_share.p ...

Encountered SyntaxError: An unexpected token has been found while integrating leaflet with flask

Despite adding all necessary scripts and configuring my API_KEY in config.js, I keep getting an error message saying "Uncaught SyntaxError: Unexpected token." I have double-checked my API key multiple times, and it seems to be correct. Here is a snippet f ...

What method can I use to replace the status bar from the top?

Is there a way to smoothly slide in and out a <View/> on React Native iOS, similar to the animation sequences shown in the images below? ...

Display logo when website has been scrolled

On my website, I want to display a logo in the header only when the site has been scrolled. I attempted to accomplish this with JavaScript: if(document.getElementById("div").scrollTop != 0){ document.write("<img src='logo.jpg'>"); } How ...