我添加了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>
1条答案
按热度按时间pbpqsu0x1#
请尝试以下操作:您缺少结尾的class=“navbar navbar-expand-lg”“