Dealing with Nested .nav-pills in Bootstrap 3: A Guide to Over

Struggling with nesting .nav-pills within another .nav-pills (utilizing bootstrap3). Could the issue be related to the nested JS in the pill-content?

I am aiming to construct a single-page website using the default JS nav pills for seamless navigation through all the content on one page. Two of the tabs contain their own JS elements, such as a carousel on the home tab and another set of nav pills.

<ul class="nav nav-pills">
  <li><a href="#home" data-toggle="pill"><span class="glyphicon glyphicon-home" >Home</a></li>
  <li><a href="#menu" data-toggle="pill"><span class="glyphicon glyphicon-cutlery"> 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 known worldwide, our Pad Thai is made with thin rice noodles stir-fried with your choice of meat, egg, bean sprouts, and green onions. Topped with crushed peanuts and lime on the side for added crunch and flavor!</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éed broccoli and Chinese broccoli in soybean paste brown 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 reside in a wild 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 -->

Answer №1

Neither the classes .pill-content nor .pill-pane actually exist.

Instead, consider using :

  • .tab-content in place of .pill-content
  • .tab-pane in place of .pill-pane

Refer to Bootstrap documentation for more information.

Pills utilize the same HTML structure as Tabs, but with the class .nav-pills instead.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Transfer various field values to jQuery

I am looking to send multiple field values to jQuery for validation, but currently only receiving the value of the changed field. How can I pass both field values to jQuery? Enter some text: <input type="text" name="txt1" value="Hello" onchange="myF ...

The POST method is failing to collect data from the form

Currently in the process of learning Web Design with HTML, PHP, and Javascript, I have taken on the challenge of creating my own website called MySite.html. Within this site, there is a sign-in screen that utilizes the POST method to send data to a file na ...

Copying content from one website to another using JavaScript

Currently, I am working on a website which stores data and I require assistance in transferring this data to another site. If you have any suggestions using Javascript or other methods, please let me know. ...

The function window.location.reload(true) is failing to properly refresh the page

Currently, I have a PHP page that retrieves data from a MYSQL database and creates HTML content based on the returned rows. I recently implemented a feature where clicking a button adds a new row to the database using AJAX, jQuery, and PHP. However, after ...

Aligning Checkbox Labels for Web Forms

Can an image convey more than a thousand words? I'm looking to align the second (and following) lines with the first one. Any suggestions? Html stands for <input><span>text</span> ...

Showing formatted JSON in the view using ASP.NET MVC

Is there a method to modify JSON for presentation in the interface? I am looking for a way to automatically update my API documentation when adding new properties. It would be great if I could also apply CSS styling to certain elements. This feature is som ...

What could be causing my ASP.net function to run only once?

In my file named file.aspx.cs, I have the following function: private void DisplayMessage(string text) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "displayingMessage", $"alert('{text}')", t ...

Incorporate SWFAddress.js into your Flex project for added functionality

Is there a method to set up my Flex 4 project so that it incorporates the JavaScript aspect of the SWFAddress library? I have successfully integrated the AS, but currently, in order to test how it works, I need to open Main.html and include swfaddress.js e ...

Double the names in a single <input>

Is it possible to assign two different names within a single input tag, like this: <input type='text' name='food' name='user_search_input'>? In my PHP file, I intend to use the input in two separate "if" clauses - one fo ...

Maintaining form data while dynamically including more instances of a <div> element to the form

I am currently developing a SpringMVC Webapp with a view that contains a dynamic form. The dynamic elements of the form are listed below: At the moment, I am passing the variable ${worksiteCount} from my controller to the view (stored in my portlet sessio ...

Whenever I add a new Task in React.js, the date is not visible to me

I'm currently deepening my understanding of React, and I've encountered a roadblock. The issue arises when I attempt to create a Tracking Task - the task is successfully created from the form inputs but the date associated with the new task isn&a ...

Issue Setting Cookies on "localhost" versus "127.0.0.1" Domain - Cookies Disappear Upon Refresh

Encountering difficulties while attempting to set cookies with the domain specified as localhost. Here is what's happening: Upon setting the cookie with localhost as the domain, an error is triggered indicating that the domain attribute is not valid ...

Difficulty redirecting Ajax call to a timed-out, CAS-protected server

Our website's login system utilizes CAS for single sign-on. The CAS server is operating the JASIG CAS server at , while our web server runs on Rails at . Due to security reasons, the Rails server has a relatively short session timeout, resulting in o ...

Creating a sleek and functional dashboard using HTML and leveraging the power of Bootstrap 4

I'm working on styling my HTML dashboard with Bootstrap 4. I want the text to be big and have minimal white space, but not too cluttered. <html> <head> <meta charset="utf-8"> <meta name="viewport" conte ...

Arrange symbols in fontawesome into a pile

Is there a way to stack grid icons in the font awesome framework to create a 3x2 grid icon? Demonstration Jsfiddle <a href="./"><i class="fa fa-square"></i> 1x1</a> <a href="./" ><i class="fa fa-square"></i>< ...

What is the best method for accessing the service response data when I am sending back an array of custom map with a promise as an object?

Sharing my code snippet below: function createObject(title, array){ this.title = title; this.array = array; } //$scope.objects is an array of objects function mapPromise(title, promise){ this.title= title; this.promise = promise; }; var fet ...

Connect a nearby dependency to your project if it has the same name as an npm repository

What is the best way to npm link a local dependency that has the same name as a project in the npm registry, like https://registry.npmjs.org/react-financial-charts? Here is an example: cd ~/projects/react-financial-charts // Step 1: Navigate to the packa ...

Tips for aligning the dot in the middle of a radio input box

I have developed a reusable Radio group component, and I am using styled components to style it. The goal is to position the dot right in the center of the circle, and it is somewhat achieving that in the screenshot below: https://i.sstatic.net/Kistg.png ...

Having trouble loading CSS in Firefox?

After creating a basic responsive website, I encountered an issue where Mozilla was not loading the CSS properly when the site was hosted on my server. Interestingly, the CSS loaded fine on Chrome and IE when viewed from my computer. Here is a snippet of ...

Vue calendar - The month display is condensed to only one row

Currently, I am incorporating bootstrap-datetimepicker for Vue (found at https://www.npmjs.com/package/vue-bootstrap-datetimepicker) via CDN. The date display looks good, however there is an issue with the month view size when selecting a month. https://i ...