我想知道我哪里出错了,但我没有看错。让有敏锐眼光的人告诉我哪里出错了。代码如下所示..
<!DOCTYPE html>
<html>
<head>
<title>bootstrap</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="portfolio.css">
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
</head>
<body>
<nav class = "navbar navbar-inverse">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#icons">
<span class="sr-only">toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Zack</a>
</div>
<div class="collapse navbar-collapse" id="icons">
<ul class="nav navbar-nav">
<li><a href="#">About Me</a></li>
<li><a href="#">Skills</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">Contact Me</a></li>
</ul>
</div>
</nav>
<script type="text/javascript" src="jquery-3.2.1.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
非常感谢stackoverflow开发人员。 :)
答案 0 :(得分:1)
我只包含了jQuery,它运行正常。您很可能错过了 jquery-3.2.1.js 文件,或者它的src路径不正确。
{{1}}
答案 1 :(得分:0)
尝试在脑中添加此内容
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
基本上你忘了触发视口 这应该工作