Skip to content
Advertisement

Bootstrap 4 Navbar Collapse doesn’t work

I have a problem with Bootstrap 4 navbar collapse feature. I set it so that the navbar collapse in mobile viewport but instead of collapsing, it shows the items as a vertical list.

This is the code:

JavaScript

I’m using a customized version of Bootstrap 4 (compiled from scss). I tried to use the standard version and it does show the button instead of the vertical list, but it doesn’t work too. When I click on the list, nothing happens. I checked the browser console but it doesn’t show any error.

If it helps this is the compiled CSS: https://pastebin.com/jKYGC5A7

And this is the SCSS: https://pastebin.com/bbQNCAvh

Advertisement

Answer

The navbar work with ul li item, here is a working example

JavaScript

Here is a link in Codepen https://codepen.io/anon/pen/LdZYbP and here is a screenshot when you’re on a mobile view

enter image description here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement