A
A
Arthur Belan2021-01-27 00:49:44
Bootstrap
Arthur Belan, 2021-01-27 00:49:44

How to properly connect bootstrap 5?

I installed Bootstap 5 via npm and connected css and js (/node_modules/bootstrap/dist/js/bootstrap.bundle.js) too, everything works including dropdown, but the modal window does not work, after I already connected css via CDN , js like according to the Bootstrap documentation , the modal window worked, but the dropdown stopped working (codepen - line 11 and 27) ))
HTML markup in codepen
With the help of crutches, I made everything work, but I had to connect js bootstrap.bundle.js (npm) and on top of it put a CDN link (so that the modal window works).
What kind of nonsense, most likely I don’t understand something, tell me what I’m doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Glebov, 2021-01-27
@SkiperX

<li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="navbarDarkDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
            Dropdown
          </a>
          <ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDarkDropdownMenuLink">
            <li><a class="dropdown-item" href="#">Action</a></li>
            <li><a class="dropdown-item" href="#">Another action</a></li>
            <li><a class="dropdown-item" href="#">Something else here</a></li>
          </ul>
        </li>

If this is pasted - works in codepen
https://getbootstrap.com/docs/5.0/components/dropd...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question