The mobile menu in bootstrap is stationary while the background scrolls instead of the menu

I recently completed a website using Bootstrap, and everything seems to be working well on desktop. However, I am facing an issue when loading the site on mobile devices. The menu is not scrolling properly when opened, making it difficult to view all the options in the dropdown. Instead of the menu scrolling, it's actually the background that is moving.

After searching for solutions online, I came across some CSS code that was supposed to fix this problem:

.navbar-nav {
  height: 150vh; // This will fix the collapse animation
}

.navbar-collapse.in {
   overflow-x: hidden;
   padding-right: 17px; // Hide scroll bar, but still allow scrolling
}

@media (min-width: 768px) {
    .navbar-nav {
        height: auto;
    }
}

Despite applying this code, the menu remains unscrollable and the issue persists. Can anyone offer insight into what might be causing this problem? You can check out the live URL of my website here. Any help would be greatly appreciated.

Thank you!

Answer №1

To address any scrolling problems, simply include the navbar-nav-scroll class alongside the current navbar-nav class.

Answer №2

After much trial and error, I was able to solve this issue by setting a specific height for the menu and adding overflow scroll property.

.navbar-nav {
  
max-height:450px;
overflow-y: auto;
}

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

Unusual Behavior of Bootstrap Buttons

<a class="btn btn-dark" href="#" role="button">Apple Music</a> Everything looks great in full resolution. View the image in full resolution here However, at a certain resolution, Bootstrap starts to act oddly. Check out the weird image beha ...

Styling your Vuetify V-data-table with CSS

Struggling to add extra spacing between table rows, despite inspecting the page and verifying that my styles are not being overridden. Have read other Vuetify posts on applying CSS but still no luck. Any suggestions for why I can't style my table as d ...

Obtaining the width of a scrollbar using JavaScript in the most recent version of Chrome

Looking for a way to determine the width of the scrollbar using JavaScript for CSS purposes. I attempted the following: document.documentElement.style.setProperty('--scrollbar-width', (document.offsetWidth - document.clientWidth) + "px" ...

PHP Content File for Dynamic Ajax Website

I recently came across a very informative article that discussed how to create crawlable and link-friendly AJAX websites using pushState. The author provided detailed instructions on the process, but left out a crucial detail - how to store data in a PHP f ...

What is the best way to create a scroll bar within a table while ensuring that the rows expand to fill the entire width?

I am attempting to design a table with 4 columns and a minimum of 12 rows while utilizing overflow-y:scroll. The webpage is completely responsive. I understand that in order to incorporate a scrollbar into the table, I must specify display: block for both ...

Post the HTML5 player on your Facebook feed

Currently, I have a player that exists in both Flash and HTML5 versions. When calling a page through an iframe, the browser and device are detected automatically to load the player accordingly, and this setup is functioning correctly. Prior to implementin ...

Rearrange the order of the next button to appear after the dropdown instead of the

When a button is clicked, the paragraph area should display while pushing down the next button/div and the rest of the page below it. In simpler terms, clicking on the button reveals the box without overlapping other elements. I apologize for any language ...

Does a browser's cache utilize storage for XMLHttpRequest responses?

I have a question regarding browsers in general, with a focus on Chrome. Imagine I have the following code snippet in my file, index.html: <img src='//path/to/foo.img'></img> The file foo.img changes on my server every hour. I woul ...

What could be causing textbox2's value to not update when textbox1's value is changed? (Novice)

I am looking to create an interactive form with two textboxes and a checkbox. When the checkbox is checked, I want the value of textbox2 to mirror whatever is typed into textbox1. Is there a way to have the value of textbox2 automatically updated when the ...

Guide on how to organize a list into three columns using a single ul tag

Is there a way to split a ul list into 3 columns using CSS? This is how my HTML structure looks like: <ul> <li>Test</li> <li>Test</li> <li>Test</li> <li>Test</li> <li> ...

problem with selection of date and month in dropdown list with jquery

Recently, I've been dabbling in jQuery and decided to create two list boxes using it. One box contains dates while the other contains months. It's quite handy since I need them in different sections of my HTML page. However, when attempting to en ...

The DOM seems to be producing NaN when receiving user input

Currently, I am in the process of developing a depreciation calculator that utilizes user input fields to generate an alert with the resulting value. When I set the variables to predefined test values without incorporating user input, the calculator funct ...

Is it possible to integrate HTML pages as sections within an HTML file using AngularJS?

There are three individuals each working on separate sections of a webpage. One is focusing on moving images, another is devoted to the tab section. This begs the question: 1) Is it feasible to embed all these HTML sections into a single HTML page and dis ...

Swap out HTML lists for a PHP array structure

For my assignment, I was tasked with creating an HTML list from an array and generating a drop-down menu based on another array. The requirement is that when a particular subject is selected from the drop-down menu, only that subject along with its teacher ...

The submit button is unresponsive and does not react to any actions

Encountering a peculiar issue! My submit button is not responding to the action. Here is the code snippet in question: <script type="text/javascript"> function save_contact_information() { document.getElementById('User_Finder&apos ...

Issue with Angular controller failing to load when link is clicked

I am currently developing a webpage that incorporates Angular and responds to ajax requests by populating data into a table. When I manually enter the address, everything works as expected. However, if I navigate to the page using a link ( <a href="/pro ...

Close the menu located in the menu bar under the Home section

I am struggling with creating the bootstrap collapse menu. <div className='collapse' id='mobile-menu'> <button clasNames='navbar-toggler' type='button' data-togg ...

Tips for monitoring password and password confirmation fields in DevTools when using AngularJS forms

Within the ng-model, I have identified two variables: vm.user.password and vm.confirmpassword. The input fields are equipped with attributes such as id, name, and class. I am interested in monitoring both the password and confirmpassword values within Dev ...

Exploring the implementation of Javascript, HTML, PHP, and Ajax in programming

<div class="navigation"> <a class="prev" href="index.php?month=__prev_month__" onclick="$('#calendar').load('index.php?month=__prev_month__&_r=' + Math.random()); return false;"></a> <!-- <div class="title" & ...

Is the scaling of a div with an image affected by odd pixel sizes?

My goal is to create a responsive grid with square images, where the first image is double the size of the others. While I can achieve this using jQuery, I am curious if there's a way to accomplish this purely with CSS. Grid: Here's an example o ...