html bootstrap5导航链接不是蓝色且未悬停

ffdz8vbo  于 2022-12-02  发布在  Bootstrap
关注(0)|答案(1)|浏览(163)

我添加了bootstrap5 CDN链接来学习引导导航,但当我添加导航链接到我的链接标记,它有正确的样式,除了蓝色是缺席和它的不悬停。但相同的代码在W3schools和codeply.com工作得很好。请我在这里需要一只手
这是我工作

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap demo</title>
 

`<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">

</head>`
<body>
    `<h1>Hello, world!</h1>

    <nav class="navbar navbar-expand-lg>
      <div class="container-fluid">
         <ul class="navbar-nav">
          <li class="nav-item">
            <a class="nav-link" href="">Link 1</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="">Link 2</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="">Link 3</a>
          </li>
        </ul>
      </div>
    </nav>`

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>

  </body>
</html>
pbpqsu0x

pbpqsu0x1#

请尝试以下操作:您缺少结尾的class=“navbar navbar-expand-lg”“

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap demo</title>
 

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">

</head>
<body>
    <h1>Hello, world!</h1>

    <nav class="navbar navbar-expand-lg">
      <div class="container-fluid">
         <ul class="navbar-nav">
          <li class="nav-item">
            <a class="nav-link" href="">Link 1</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="">Link 2</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="">Link 3</a>
          </li>
        </ul>
      </div>
    </nav>`

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>

  </body>
</html>

相关问题