Collapsed links not appearing in navbar toggler

Within my container-fluid cont, I am customizing my navigation bar using Bootstrap.

The issue I am facing is that when I toggle the hamburger icon, nothing appears. My goal is for the navigation to collapse in mobile view, and upon clicking the toggler, the ul list of links should be displayed. What adjustments can I make?

<!-- NAVIGATION BAR -->
<nav class="navbar fixed-top navbar-expand-sm navbar-custom navbar-light">
    <a class="navbar-brand js-scroll-trigger" href="index.html"><img src="images/logo.png" height="50px" width="auto"></a>

    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCustom" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarCustom">
        <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
            <li class="nav-item active samecolor">
                <a class="nav-link" href="#home">HOME</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#orari">SCHEDULE</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#luogo">LOCATION</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="about.hmtl">ABOUT US</a>
            </li>
        </ul>
    </div>  
</nav>

Here are some CSS changes I made:

/*CUSTOMIZING BOOTSTRAP NAVIGATION*/
.navbar-custom { 
    background-color: #F5D236; 
} 

.navbar-custom .navbar-nav .nav-link {
    color: #223D94;
}

/* change the color of active or hovered links */
.navbar-custom .nav-item.active .nav-link,
.navbar-custom .nav-item:hover .nav-link {
    color: #223D94;
}

.navbar-custom .dropdown-item {
    color: #223D94;
}

Answer №1

Oops, I totally forgot to include the necessary JS files!

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

https://getbootstrap.com/docs/4.3/getting-started/introduction/

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

Pagination in cakePHP3 is malfunctioning after applying filters to the search results

I am encountering an issue with pagination in CakePHP3. I have 2 Pages - one displaying all data and the other with a filter option. On the first page (All Datas), the Pagination seems to work fine. However, on the second page (filter), the Pagination only ...

Toggle among 10 divs, but automatically revert back to the initial div if there is no mouse activity for a short period

My website has 9 links in the header and 10 divs in the body. The first div serves as the main page, while the remaining 9 divs contain different content. I would like to implement a feature where when users hover over the 9 links, it displays one of the 9 ...

Is it possible to center my tab on the page and add captions as well?

Struggling to align a tab with 3 image buttons in the middle, I resorted to using manual margin adjustments. I also added captions separately from the buttons for aesthetic purposes, but know this is not the correct way. Is there a way to attach the captio ...

The Spring Boot REST application is unexpectedly returning HTML instead of JSON, causing confusion for the Angular application which is unable to recognize the

I am struggling with my Spring Boot application that was generated using . I am having difficulty getting it to return JSON instead of HTML. Here is a snippet of the code: [@CrossOrigin(origins="http://localhost:4200",maxAge=3600) @RestController @Request ...

The hover animation is not functioning properly in Icomoon

I have implemented a menu with a CSS3 hover animation called toTopFromBottom. Now, I want to replace the Font Awesome icons with Icomoon icons and apply the same animation effect: HTML: <div id="top-bar" class="top-bar"> <div class="container" ...

Is it truly unsemantic to use transparent <hr> elements for responsive vertical spacing?

I've recently adopted a unique technique for managing vertical spacing in front-end design by using transparent <hr> elements as spacers. I understand that this method is not favored among most of the web community, but I believe it has its meri ...

Click on the button to reveal the hidden content within the div, and then smoothly scroll down to view

I have a footer div that is present at the bottom of every page on our site. I've added a button to expand this div, but I'm looking for a way to automatically scroll the page down so that the user can view the expanded content without manually s ...

The webpage loaded through ajax is not rendering correctly

One of the challenges I'm facing is getting a JavaScript script to load an HTML page into a specific div element on another HTML page: The page that's being loaded, startScreen.html, looks like this: <!DOCTYPE html> <html lang="en ...

Make sure two elements are siblings in JavaScript / jQuery

Looking at the HTML structure below: <div class="wrap"> <div id="a"></div> <div id="b"></div> </div> A statement is presented as false: ($('#a').parent() == $('#b').parent()); //=> false ...

A mobile phone screen cannot be fully filled by an image

I'm working on a way for an image to cover the entire screen of a mobile phone. However, when I preview it on an iPhone through a laptop, the image only covers a small portion of the iPhone's screen rather than filling it completely. Below is the ...

Ways to retrieve data from an AJAX success callback function

Within my front end JavaScript application, I need to execute an ajax request in order to retrieve data from the server. Once this data is acquired, I aim to display it within the view. var retrievedData; $.ajax({ url:"/getDataFromServer.json", ty ...

Ways to send a list with dictionaries in an HTML template and retrieve their data

Within my Django project, I am dealing with a specific list: my_list=[{'id':1,'username':'sometext'},{'id':2,'username':'someothertext'}] I have passed this list to the template using the followi ...

Send a JavaScript variable to Twig

I am trying to pass a JavaScript variable to a twig path but the current method I am using is not working as expected. <p id="result"></p> <script> var text = ""; var i; for (varJS = 0; varJS < 5; varJS++) { text += "<a href= ...

Hiding or removing DOM elements with ng-bootstrap pagination

I am in the process of incorporating pagination into my project using ng-bootstrap pagination. In my HTML, I am combining an ngFor loop with the slice pipe to filter elements for display. <tr *ngFor="let bankAccount of bankingAccounts | slice: (p ...

Enhance Your Website with Dynamic Navigation Animation

Seeking assistance with animating a navigation bar on and off the screen from the left side. The nav is not animating as expected using the latest version of jquery.min.js. The first step was to animate the nav upon clicking an object. View the current pro ...

Choosing the Date Picker in Selenium WebDriver: A Step-by-Step Guide

Currently delving into Selenium WebDriver with a focus on Java. My goal is to navigate through a date picker dropdown and select specific values for date, month, and year. Here is an example of the HTML tag: <dd id="date-element"> <input id="fro ...

Unable to process form submission with AngularJS + Stormpath

I am facing an issue with form submission. Even though I believe that the login and password data are being sent correctly, nothing happens when I submit the form. I am attempting to submit the form without using ngSubmit because it is not feasible in my s ...

Querying cookies using Jquery/Ajax

Is there a way to trigger an ajax call when a page detects the presence of a cookie? I'm having trouble getting the ajax call to work in the code below. Any assistance would be greatly appreciated. EDIT: I have updated the code and it is now function ...

Are variables initialized before the execution of ajax?

After reviewing the code snippet provided below, can we confirm with certainty that the id variable passed in the ajax call will consistently be assigned a value of 1? Or is there a possibility that the id could potentially be null or undefined at some p ...

How can jQuery be used to automatically populate text fields based on the selected option in a drop-down menu?

An Invoice contains a list of LineItems. LineItems consist of a name (in a select menu), price, and quantity properties. By default, each invoice includes 3 empty line items to accommodate user additions. If the user chooses a line item from the drop-do ...