Anchor links in bootstrap don't work

血红的双手。 提交于 2019-12-13 09:49:27

问题


I am using bootstrap 3.2.0. I have some content in the tabs and I want to create an anchor link to this content in the tabs to different websites. Here is my code:

        <div class="bs-docs-example">
         <div class="tabbable tabs-left">
            <ul class="nav nav-tabs">

                <li><a href="#1A" data-toggle="tab"> Sample#1 </h1></a></li>
                <li><a href="#2A" data-toggle="tab"> Sample#2 </h1></a></li>
             </ul>
            <div class="tab-content">

                <div class="tab-pane" id="1A">

                    <li id="ndf_35"></li>

                </div>
                <div class="tab-pane" id="2A">

                    <li id="ndf_36"></li>


                </div>



            </div>
        </div>
    </div>

I create the link like this :

    <a href="http://www.example.com/page1#ndf_36">some text </a>

But it's not working. Does anyone have an idea how to fix this?


回答1:


Demo

Its working fine.

Check that

  • You have included jquery (you need jquery for bootstrap.js)
  • You have included bootstrap.js
  • open <h1> tags


来源:https://stackoverflow.com/questions/25290137/anchor-links-in-bootstrap-dont-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!