简体   繁体   English

菜单栏移动 select 整个导航栏而不是点击按钮

[英]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.

相关问题 如何通过单击整行而不是“编辑”按钮来显示模式 - How to show modal by clicking on the whole row instead of “Edit” button 如何在不单击jQuery Mobile中的任何按钮的情况下选择数据 - How to select data without clicking on any button in jquery mobile 导航栏引导菜单未在移动设备中显示 - Navbar bootstrap menu not showing in mobile 单击菜单按钮后,如何在 wordpress 中将移动导航栏菜单背景颜色从透明更改为靛蓝? - How to change in wordpress the mobile navbar menu background color from transparent to indigo as soon as the menu button is clicked? 在一个 WordPress 主题上调整浏览器窗口大小时,导航栏不起作用,并且在添加 JS 代码后移动菜单关闭按钮不起作用 - Navbar is not working when resizing the browser windows on one WordPress theme and after adding the JS code mobile menu close button is not working 如何在Wordpress中将搜索栏添加到移动菜单? - How to add the search bar to mobile menu in wordpress? 移动菜单栏不工作引导模板 - Mobile Menu Bar not working Bootstrap Template 新增 <select>通过单击按钮进行标记 - Adding new <select> tag by clicking on the button 用wordpress博客中的所有菜单项替换手机上的菜单切换按钮 - Replace menu toggle button on mobile with all items of menu in wordpress blog 单击按钮时如何只更新1行而不是所有行 - How to only update 1 row instead of all the rows when clicking a button
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM