dougaoshang0237 2017-01-31 07:37
浏览 113
已采纳

如何从引导程序模板编辑导航栏并将其转换为具有相同设计的下拉列表?

How to edit navbar from bootstrap templates and convert it into dropdown with same design? I want it like when I hover on the word that it will show the same color as the background color of the navbar

 <nav id="mainNav" class="navbar navbar-default navbar-fixed-top">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span> Menu <i class="fa fa-bars"></i>
                </button>
                <a class="navbar-brand page-scroll" href="#page-top">Start Bootstrap</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a class="page-scroll" href="#about">Log In</a>
                    </li>
                    <li>
                        <a class="page-scroll" href="#about">About</a>
                    </li>
                    <li>
                        <a class="page-scroll" href="#services">Services</a>
                    </li>
                    <li>
                        <a class="page-scroll" href="#portfolio">Portfolio</a>
                    </li>
                    <li>
                        <a class="page-scroll" href="#contact">Contact</a>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container-fluid -->
    </nav>

This is the part that I want to convert into a dropdown with same design. I don't need the page-scroll on this part and the href coz I want the things in the dropdown to have the href. What do I need to do?

   <li><a class="page-scroll" href="#about">Log In</a></li>
  • 写回答

2条回答 默认 最新

  • douqiaolong0528 2017-01-31 08:01
    关注

    You can easily implement by implementing data-toggle dropdown

     <li>
          <div class="dropdown">
              <a href="#" class="btn btn-simple dropdown-toggle" data-toggle="dropdown" style="line-height:2.428571;">
                  Log in
                  <b class="caret"></b>
              </a>
          <ul class="dropdown-menu">
               <li><a href="about-us.html">About Us</a></li>
               <li><a href="about-gbg.html">About GBG</a></li>
          </ul>
          </div>
    </li>
    

    Demo : https://jsfiddle.net/ez2tacju/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch