[英]Menu bar mobile select the whole navbar instead of clicking the button
When I try to open the menu on mobile, it does not open and instead, you just select the whole menu bar.当我尝试在移动设备上打开菜单时,它并没有打开,而是你只是 select 整个菜单栏。 It looks like this on the actual website:
在实际网站上看起来像这样:
meanwhile, this is the relevant code for the navbar.php同时,这是导航栏的相关代码。php
<link href="assets/css/style.css" rel="stylesheet">
<nav class="navbar navbar-default">
<div class='container'>
<div class="navbar-header">
<button type="button" id='navbar-toggle' class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-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>
<div class="brand">
<a href="../index"><img src="assets/img/transparentlogo.png" alt="logo"></a>
</div>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-left">
<li><a href="index">Home</a></li>
<li><a href="services">Services</a></li>
<li><a href="about">About</a></li>
<li><a href="contact">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="contact" class="book">Contact Us</a></li>
</ul>
</div>
</div>
also, not sure if it makes a difference although the PHP file is named navbar.inc.php Thank you for taking the time to read this post另外,虽然 PHP 文件被命名为 navbar.inc.php,但不确定它是否有所不同 感谢您抽出宝贵时间阅读这篇文章
<div class="brand">
<a href="../index"><img src="assets/img/transparentlogo.png" alt="logo"></a>
</div>
Maybe you should carry brand class' properties to anchor tag and remove brand class.也许您应该携带品牌类的属性来锚定标签并删除品牌 class。
<a class="brand" href="../index"><img src="assets/img/transparentlogo.png" alt="logo"></a>
Or, you should check if your anchor tag () is covering all the space under the div having "brand" class.或者,您应该检查您的锚标记 () 是否覆盖了具有“品牌”class 的 div 下的所有空间。 In my opinion you cannot click it on phone, because a' is not taking all the width and height.
在我看来,你不能在手机上点击它,因为 a' 没有占用所有的宽度和高度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.