我试图在我的桌面浏览器上挤压和扩展它的工作原理。但是,当文件托管在我的服务器上并且我在手机上访问该网址时,它无法正常工作。
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" 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>
<a class="navbar-brand" href="#">Brand</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#" id="brand1">brand1<span class="sr-only">(current)</span></a></li>
<li><a href="#" id="brand2">brand2</a></li>
<li><a href="#" id="brand3">brand3</a></li>
<li><a href="#" id="brand4">brand4</a></li>
<li><a href="#" id="brand5">brand5</a></li>
</ul>
</div>
</div>
</nav>
答案 0 :(得分:1)
我错过了标题中的元标记以获得移动兼容性。
<meta name="viewport" content="width=device-width, initial-scale=1">