我有一个index.html,需要通过cdn引导bootstrap.css和bootstrap.js。当我在桌面上折叠浏览器时,导航栏会正常折叠。当我在我的移动设备上访问该网站时,除导航栏外,所有内容都会响应。
的index.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" id="the-navbar">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1">
<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="#">Stuff</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<div class="navbar-right">
<ul class="nav navbar-nav">
<li><a href="#what-we-do"><span class="glyphicon glyphicon-info-sign"></span> About CSC</a></li>
<li><a href="#how-we-do-it"><span class="glyphicon glyphicon-ok"></span> The Results</a></li>
<li><a href="#the-plan"><span class="glyphicon glyphicon-road"></span> The Methods</a></li>
<li><a href="#contact-us"><span class="glyphicon glyphicon-envelope"></span> Let's Chat</a></li>
</ul>
</div>
</div>
</div>
</nav>
... some content ...
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="js/app.js"></script>
和style.css中的navbar相关的css
@media screen and (max-width: 800px) {
.navbar .glyphicon {
display: none;
}
}
#the-navbar {
background-color: #2548AE;
border: none;
min-height: 80px;
padding-top: 15px;
}
#the-navbar .navbar-brand {
font-size: 1.5em;
}
#the-navbar a {
color: #FFF;
font-size: 1.1em;
}
#the-navbar a:hover {
border-bottom: 2px #FFF solid;
}
有没有人看到导航栏在桌面上正常折叠的原因,而不是我在移动设备上加载页面时的原因?
感谢。