gpt4 book ai didi

javascript - Bootstrap 导航栏不会在移动设备上缩小

转载 作者:行者123 更新时间:2023-11-29 17:59:44 25 4
gpt4 key购买 nike

如果我只是缩小 Chrome 中的窗口,navbar 将按预期工作,但是当我进入 chrome 的设备模拟器时,navbar 永远不会改变切换按钮。

<nav id="mainNav" class="navbar navbar-default navbar-fixed-top affix-top" style="border:0;background-color:transparent;position:absolute;">
<div class="container-fluid" style="padding: 20px 15% 0;">
<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 page-scroll" href="#page-top"><img class="img-responsive" src="/logo.png"></a>
</div>
<div class="navbar-collapse collapse" id="bs-example-navbar-collapse-1" aria-expanded="false" style="height: 1px;">
<ul class="nav navbar-nav navbar-right">
<li>
<a class="page-scroll" href="#about">
<span>Rewards</span>
</a>
</li>
<li>
<a class="page-scroll" href="#services">
<span>Member Care</span>
</a>
</li>
<li>
<a class="page-scroll" href="#portfolio">
<span>Sign Up</span>
</a>
</li>
<li>
<a class="page-scroll login-btn" href="#login-form">
Log In <i class="fa fa-user"></i>
</a>
</li>
</ul>
</div>
</div>
</nav>

最佳答案

您可以先确认您已在页面头部设置视口(viewport)元标记

<meta name="viewport" content="width=device-width, initial-scale=1.0">

关于javascript - Bootstrap 导航栏不会在移动设备上缩小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35848301/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com