Mobile top menu in bootstrap not functioning as expected

This fixed top menu is functioning correctly on desktop, but it's not working on mobile. How can I make it work on mobile devices?

Bootstrap and Font Awesome are being used.

Below is the code snippet:

        <!-- Navigation -->
    <header class="nav">
        <div class="nav__holder nav--sticky">
            <div class="container-fluid nav__container nav__container--side-padding">
                <div class="flex-parent">

                    <div class="nav__header">
                        <!-- Logo -->
                        <a href="index.php" class="logo-container flex-child">
                            <img class="logo" src="img/ERRE_logo_2.png" srcset="img/ERRE_logo_2.png 1x, img/ERRE_logo_2.png 2x" alt="logo">
                        </a>

                        <!-- Mobile toggle -->
                        <button type="button" class="nav__icon-toggle" id="nav__icon-toggle" data-toggle="collapse" data-target="#navbar-collapse">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="nav__icon-toggle-bar"></span>
                            <span class="nav__icon-toggle-bar"></span>
                            <span class="nav__icon-toggle-bar"></span>
                        </button>
                    </div>

                    <!-- Navbar -->
                    <nav id="navbar-collapse" class="nav__wrap collapse navbar-collapse">
                        <ul class="nav__menu">
                            <li class="nav__dropdown active">
                                <a href="index.php" aria-haspopup="true">Home</a>
                                <i class="ui-arrow-down nav__dropdown-trigger" role="button" aria-haspopup="true" aria-expanded="false"></i>

                            </li>
                            <li class="nav__dropdown">
                                <a href="portfolio-gallery.html" aria-haspopup="true">Portfolio</a>
                                <i class="ui-arrow-down nav__dropdown-trigger" role="button" aria-haspopup="true" aria-expanded="false"></i>


                            </li>
                            <li class="nav__dropdown">
                                <a href="#services" aria-haspopup="true">Services</a>
                                <i class="ui-arrow-down nav__dropdown-trigger" role="button" aria-haspopup="true" aria-expanded="false"></i>
                            </li>


                            </li>
                            <li class="nav__dropdown">
                                <a href="#contacts" aria-haspopup="true">Contacts</a>
                                <i class="ui-arrow-down nav__dropdown-trigger" role="button" aria-haspopup="true" aria-expanded="false"></i>
                            </li>

                        </ul> <!-- end menu -->

Any suggestions on how to resolve this issue?

Answer №1

I successfully resolved the issue by updating the following code snippet:

<li class="nav__dropdown">
To the improved version: <li class="">

The problem has been rectified and everything is functioning smoothly now.

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

Combining Two DIVS Side by Side

Hey there, I am working on a timeline using two divs within a table cell. My goal is to have these divs overlap instead of appearing one below the other. The position attribute for all the DIVs inside the cell must remain unchanged due to the drag/drop fu ...

Could it be that grid-area does not function properly with the attr function, or is this intentional?

The following examples showcase the functionality: It's impressive how I'm utilizing content: attr(class) to streamline the labeling process. Impressive! section { outline: 1px solid red; display: grid; grid-gap: 10px; grid-template-a ...

Experience full-screen viewing by double-clicking without the distraction of video controls (WordPress/HTML5)

I've been tasked with creating a video thumbnail that, when clicked, will lead the user to a new page where a single autoplaying and looping mp4 video will be shown. The issue arises when I can't interact with the video because the controls are h ...

How can I omit spaces in the HTML output when saving a data frame using to_html?

After using the to_html method, I noticed that there are \n after > and spaces before <. Is there a way to prevent them from being saved? Here is an example of what I have: <table border="1" class="dataframe"> <t ...

Mastering Bootstrap: Achieving flawless column stacking in succession

I am currently integrating bootstrap into my existing HTML code, but I only require it in two specific sections to avoid rewriting the entire code. Everything looks fine on my 1080p screen as intended. However, when I resize the screen slightly The titl ...

Which HTML tag should I choose to apply color to text in Twitter Bootstrap?

I'm looking to enhance the appearance of a specific word in my text. For example: This is my text, <span class="red">this</span> should be red. Would using the span tag be the appropriate method for achieving this effect? Or are there ot ...

Best Practices for CSS Naming in MVC Architecturelayouts

Creating a CSS naming convention within an MVC Project with Layouts can be a challenging task. The use of Layouts introduces the necessity of being cautious when selecting class names, as they could potentially be overridden by classes declared in the Lay ...

Include a scrollbar within a Bootstrap table grid under a div with a width of 12 columns

How can I add a scrollbar to the grid below? It is using a bootstrap table inside a bootstrap col 12 div. I have attempted to use the following CSS, but it does not apply a scrollbar, it only disrupts the columns. divgrid.horizontal { width: 100%; ...

What is the process for assigning various hyperlinks to database array outputs?

https://i.sstatic.net/AuYe7.jpg I've got an array of usernames pulled from a database. By using a for each loop, I'm able to display these usernames along with additional information like paragraphs written by the users and the date those paragr ...

Having multiple divs lined up horizontally on a single row

I am trying to create three divs in a single row similar to this: https://i.sstatic.net/A63Sx.png Any assistance on how to achieve this setup would be greatly appreciated. ...

Enhancing user interfaces with jQuery by updating DOM elements

Can anyone help me figure out how to update a webpage so it functions as a report that multiple people can contribute to? I'm using forms to collect data and want it to instantly display under the correct category headings. Currently, I'm using j ...

Tips for customizing the User Interface in Tibco Spotfire Webplayer

My company's theme doesn't match with the default user interface of TIBCO Spotfire WebPlayer. I tried changing the Stylesheets in the installation directory to customize the colors, but when I refresh the login page, it still shows the old blue w ...

Full-screen background with image adhering perfectly - left-aligned button that stays in place

Excuse me if my question seems basic, as I am just starting out in front-end development and may not know all the necessary terms to fully understand existing questions. I currently have a simple html file that consists of a title and three buttons, with ...

Having trouble importing JS into HTML file with NodeJS

I have created a web server using NodeJS that serves the file index.html. However, when I attempt to add a JavaScript file to my HTML document, the browser displays an error message stating The resource "http://localhost:3000/includes/main.js" was blocked ...

The functionality of multiple UI-Views is not meeting the intended outcomes

I'm facing an issue with integrating multiple UI-views in my AngularJS dashboard app. Despite following the directory structure, I am unable to get it working as expected. This is how my directories are organized: index.html app/ app.js dash ...

Change "ul li" on the fly

My unordered list contains list items with a badge span indicating the number of unread messages. I am trying to rearrange the list items so that those with the highest number are at the top and those with the lowest or none are at the bottom. Despite tryi ...

Receiving an inaccurate value from the input with type='number' attribute

There is an input field where users can enter a string, and I need to capture the value entered into it. $("#test").on("change", function(){ console.log($(this).val()); }) <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery ...

Using JavaScript to insert new rows into a table

Currently, I have a form with master-detail data. I've set up a table for the details and added rows using JavaScript upon button click. However, whenever I click the "Add Row" button, a new row is added momentarily before the page reloads, causing th ...

When Electron.Net is launched, the default menu is displayed first and then switches to a custom menu upon

Currently, I am using Electron.Net to wrap an ASP.Net MVC webpage and my objective is to replace the default menu with a custom one. I have successfully implemented the custom menu code, but there seems to be an issue when running the program using electro ...

Using HTML files in Node.js

I'm struggling to understand how to include a file in Node.js. While other questions are focused on including JS files, I specifically need assistance with including files that contain HTML content, similar to the PHP include function. In PHP, I typi ...