current position:Home>Bootstrap navigation bar drop-down menu does not take effect

Bootstrap navigation bar drop-down menu does not take effect

2022-04-29 12:51:38I'm a genius

Here I use bootstrap3.0 Version of .
As shown in the figure, according to the official document
 Insert picture description here
Just import two of them ,css And script that will do .
But it still fails after import . Only later do I know that I still need to import
jquery

 <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>

The following is my personal test ok Of

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <!--  Latest version  Bootstrap  The core  CSS  file  -->
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
  <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
  <!--  Abreast of the times  Bootstrap  The core  JavaScript  file  -->
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>

</head>
<body>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
  <ul class="dropdown-menu">
    <li><a href="#">Action</a></li>
    <li><a href="#">Another action</a></li>
    <li><a href="#">Something else here</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="#">Separated link</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="#">One more separated link</a></li>
  </ul>
</li>
</body>
</html>

There are also requirements for import sequence , First bootstrap Of css, then jquery Of js, And then there was bootstrap Of js

copyright notice
author[I'm a genius],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204291136190651.html

Random recommended