简体   繁体   English

切换到移动视图时,Bootstrap Toggle Burger Menu 不起作用

[英]Bootstrap Toggle Burger Menu not working when switched to mobile view

<nav class="navbar navbar-expand-lg navbar-dark  px-2 " style="background-color:#E53935;">
          <a class="navbar-brand" href="#">HeadOverMeals</a>
          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav ">
              <li class="nav-item active">
                <a class="nav-link" href="#">Home</a>
              </li>
              <li class="nav-item active">
                <a class="nav-link" href="#">Contact</a>
              </li>
              <li class="nav-item active">
                <a class="nav-link" href="#">Cart</a>
              </li>
            </ul>
          </div>
        </nav>

Make sure you have followed these steps: Step 1: Add proper "css" file inside the "header tag" and the "javascript" file at the end of the "body tag".确保您已按照以下步骤操作: 第 1 步:在“header tag”中添加正确的“css”文件,并在“body tag”末尾添加“javascript”文件。 You can find the links over here https://www.bootstrapcdn.com/你可以在这里找到链接https://www.bootstrapcdn.com/

Step 2:Try copying the default navbar from the bootstrap website and then editing it.第 2 步:尝试从引导网站复制默认导航栏,然后对其进行编辑。 You can find it over here https://getbootstrap.com/docs/4.0/components/navbar/你可以在这里找到它https://getbootstrap.com/docs/4.0/components/navbar/

I faced the similar problem and the step-1 solved it.我遇到了类似的问题,第 1 步解决了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM