Bootstrap基础导航栏(响应式导航菜单)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../bootstrap-3.4.1-dist/css/bootstrap.min.css">
<script src="../js/jquery.min.js"></script>
<script src="../bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
<title>Bootstrap基础导航栏(响应式导航菜单)</title>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- 这里可以定义品牌图标 role可访问,共享 -->
<div class="navbar-header">
<a href="#" class="navbar-brand" id="nav-brand-itheima">
网站首页
</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="##">系列教程</a></li>
<li><a href="##">产品介绍</a></li>
<li><a href="##">成功案例</a></li>
<li><a href="##">关于我们</a></li>
</ul>
</div>
</nav>
</body>
</html>
页面效果
点击右上角可以展开
浏览器界面大小不同形态不同