简体   繁体   English

Bootstrap 3:嵌套的.nav-pills问题

[英]Bootstrap 3 : nested .nav-pills trouble

Trouble nesting .nav-pills in another .nav-pills (using bootstrap3). 无法将.nav-pills嵌套在另一个.nav-pills中(使用bootstrap3)。 Maybe its the nested JS in the pill-content? 也许它是药丸内容中的嵌套JS?

Basically I would like to create a single page website using the built in JS nav pills to navigate all the content on one page. 基本上,我想使用内置的JS导航丸创建一个页面的网站,以浏览一页上的所有内容。 Two of the panes contain built in JS too a carousel on home and another nav pill. 其中两个窗格中还包含内置JS的家用旋转木马和另一个导航药丸。

<ul class="nav nav-pills">
  <li><a href="#home" data-toggle="pill"><span class="glyphicon glyphicon-home"></span> Home</a></li>
  <li><a href="#menu" data-toggle="pill"><span class="glyphicon glyphicon-cutlery"></span> Menu</a></li>
  <li><a href="#about" data-toggle="pill">About Us</a></li>
  <li><a href="#contact" data-toggle="pill">Contact Us</a></li>
  <li><a href="#directions" data-toggle="pill">directions</a></li>
</ul><!-- End Nav pills -->

<!-- pill panes -->
<div class="pill-content">
  <div class="pill-pane active" id="home">

    <!-- Carousel -->
   <div id="carousel-with-captions" class="carousel slide" data-ride="carousel">
    <ol class="carousel-indicators">
      <li data-target="#carousel-with-captions" data-slide-to="0" class="active"></li>
      <li data-target="#carousel-with-captions" data-slide-to="1"></li>
      <li data-target="#carousel-with-captions" data-slide-to="2"></li>
    </ol>
    <div class="carousel-inner">
      <div class="item">
        <img src='img\carousel\N2.-Pad-Sea-Ewew.jpg'  width="100%" alt="First slide image">
        <div class="carousel-caption">
          <h3>N2. Pad Sea Ewew (ผัดซีอิ๋ว)</h3>
          <p>Stir fried thick rice noodles with egg, Chinese broccoli, broccoli and beansprouts in sweet black soy sauce.</p>
        </div>
      </div>
      <div class="item active">
        <img src="C:\Users\Eduardo\Desktop\Pi's Thai\img\carousel\N1.-Pad-Thai.jpg" width="100%" alt="Second slide image">
        <div class="carousel-caption">
          <h3>N1. Pad Thai (ผัดไทย)</h3>
          <p>Notably one of the best known Thai dish worldwide. Our Pad Thai is made with thin rice noodles stir fried with meat of your choice, egg, bean sprouts and green onions. Then topped with crushed peanuts and a side of lime to add some crunch and an extra zest!</p>
        </div>
      </div>
      <div class="item">
        <img src="C:\Users\Eduardo\Desktop\Pi's Thai\img\carousel\N3.-Pad-Rard-Na.jpg" width="100%" alt="Third slide image">
        <div class="carousel-caption">
          <h3>N3. Pad Rard Na (ราดหน้า)</h3>
          <p>Stir fried thick rice noodles topped with sautéd broccoli and Chinese broccoli in soybean paste brown soy gravy.</p>
        </div>
      </div>
    </div>
    <a class="left carousel-control" href="#carousel-with-captions" data-slide="prev">
      <span class="glyphicon glyphicon-chevron-left"></span>
    </a>
    <a class="right carousel-control" href="#carousel-with-captions" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right"></span>
    </a>
  </div><!-- End Carousel -->
  </div><!-- End Pill pane home -->

  <div class="pill-pane" id="menu">

    <ul class="nav nav-pills">
      <li class="active"><a href="#Noodles" data-toggle="pill">Noodles</a></li>
      <li><a href="#FriedRice" data-toggle="pill">Fried Rice</a></li>
      <li><a href="#Entrees" data-toggle="pill">Entrees</a></li>
      <li><a href="#Soups-Salads" data-toggle="pill">Soups &amp; Salads</a></li>
    </ul>
    <div class="pill-content">
    </div>         
  </div><!-- End Pill pane menu -->

  <div class="pill-pane" id="about">
    <h3>about us</h3>
    <p>we live in a crazy  jungle</p>
  </div><!-- End Pill pane about us -->

  <div class="pill-pane" id="contact"
  ></div><!-- End Pill pane contact us -->

  <div class="pill-pane" id="directions"
  ></div><!-- End Pill pane directions -->
</div><!-- End Pill panes -->

Both classes .pill-content and .pill-pane doesn't exists. .pill-content.pill-pane这两个类都不存在。

Just use : 只需使用:

  • .tab-content instead of .pill-content .tab-content而不是.pill-content
  • .tab-pane instead of .pill-pane .tab-pane而不是.pill-pane

Bootstrap doc : 引导文档:

Pills take that same HTML [as Tabs], but use .nav-pills instead. 药丸采用与[Tabs]相同的HTML,但改用.nav-pills

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

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