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 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)