甚至无法使 Bootstrap 轮播示例代码正常工作。特别是上一个和下一个按钮

Can't even make the Bootstrap carousel example code work. Specifically the prev and next buttons

我正在探索 Bootstrap 的基础知识,一切似乎都运行良好(非常基本的东西、表格、列等)。但是,我尝试按照 bootstrap 网站上的示例制作轮播,但没有成功。旋转木马看起来一切正常,但下一个和上一个按钮没有任何作用。

所以我只是直接复制了网站上的例子,同样的事情发生了,一切都在那里,但没有功能。我正在使用 WebStorm 给我的 bootstrap 文件,但我将其更改为 CDN 链接作为故障排除步骤无济于事。

我在 Edge 和 Chrome 中也尝试过。 [edit]我还尝试了一个我在 SO 上找到的建议,将锚标签更改为按钮的按钮标签,但它没有用[/edit]

我是不是遗漏了某个地方的依赖项?我相信我拥有我需要的一切:

谢谢。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
    <title>Title</title>
</head>
<body>
  <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
      <ol class="carousel-indicators">
          <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
          <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
          <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
      </ol>
      <div class="carousel-inner">
          <div class="carousel-item active">
              <img class="d-block w-100" src="https://placeimg.com/1080/500/animals" alt="First slide">
              <div class="carousel-caption d-none d-md-block">
                  <h5>My Caption Title (1st Image)</h5>
                  <p>The whole caption will only show up if the screen is at least medium size.</p>
              </div>
          </div>
          <div class="carousel-item">
              <img class="d-block w-100" src="https://placeimg.com/1080/500/arch" alt="Second slide">
          </div>
          <div class="carousel-item">
              <img class="d-block w-100" src="https://placeimg.com/1080/500/nature" alt="Third slide">
          </div>
      </div>
      <button class="carousel-control-prev" data-target="#carouselExampleIndicators" role="button" data-slide="prev">
          <span class="carousel-control-prev-icon" aria-hidden="true"></span>
          <span class="sr-only">Previous</span>
      </button>
      <button class="carousel-control-next" data-target="#carouselExampleIndicators" role="button" data-slide="next">
          <span class="carousel-control-next-icon" aria-hidden="true"></span>
          <span class="sr-only">Next</span>
      </button>
  </div>
  <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
</body>
</html>

就像@CBroe 在评论中指出的那样,存在版本不匹配,代码适用于 Bootstrap 4.0,而我使用的 Bootstrap 版本是 5.0。