Integrate div columns within the content of Bootstrap tabs

Utilizing the X-tabs plugin, I have been working with Bootstrap 3 tabs and styling them as shown below:

HTML :

<div class='tabs-x tabs-below'>
    <div id="myTabContent-2" class="tab-content">
        <div class="tab-pane fade in active" id="home-2">
            <div class="col-xs-4 col-md-2">
                <p>The FALSE Tabs</p>
            </div>
        </div>
        <div class="tab-pane fade" id="profile-2">
            <p>The True TaBs WORKED</p>
        </div>
    </div>
    <ul id="myTab-2" class="nav nav-tabs" role="tablist">
        <li class="active"><a href="#home-2" role="tab" data-toggle="tab">Home</a>

        </li>
        <li><a href="#profile-2" role="tab-kv" data-toggle="tab">Profile</a>

        </li>
    </ul>
</div>

I attempted to add a new div within the tabs content like this:

<div class="col-xs-4 col-md-2"></div>

The problem arises when this div appears outside of the tabs content and does not function correctly. How can this issue be resolved?

View DEMO FIDDLE here (note the problem in the first tab, whereas the second tab functions correctly).

Answer №1

One issue arises from creating a bootstrap column without a corresponding row in the Home tab content. Bootstrap columns are floated elements, so it is important to either clear floats manually or enclose them within a .row div.

For examples of Bootstrap grid templates, you can refer to: http://getbootstrap.com/examples/grid/

Demo: Check out this demonstration at http://jsfiddle.net/ce4xcyay/2/

<div class='tabs-x tabs-below'>
    <div id="myTabContent-2" class="tab-content">
        <div class="tab-pane fade in active" id="home-2">
            <div class="row">
                <div class="col-xs-4">
                    <p>The FALSE Tabs</p>
                </div>
            </div>
        </div>
        <div class="tab-pane fade" id="profile-2">
            <p>The True TaBs WORKED</p>
        </div>
    </div>
    <ul id="myTab-2" class="nav nav-tabs" role="tablist">
        <li class="active"><a href="#home-2" role="tab" data-toggle="tab">Home</a>

        </li>
        <li><a href="#profile-2" role="tab-kv" data-toggle="tab">Profile</a>

        </li>
    </ul>
</div>

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

Can a fixed div be made to adapt to different screen sizes?

Struggling to make SVG data charts responsive due to the 'position:fixed' CSS attribute applied, I'm exploring alternative solutions that don't involve media queries. Ideally, I want the SVG to scale up and down while remaining centered ...

Navigate one level up or down from the current tag that contains a specified value by utilizing Scrapy

To extract the price text from within the custom-control / label / font style, I must use the data-number attribute data-number="025.00286R". This unique identifier differentiates between control section divs based on the letter at the end. <d ...

Guide on incorporating Bootstrap JS into HTML5 reusable web elements

RESOLVED: the solution is in a comment TL;DR: Issues triggering Bootstrap's JS, likely due to incorrect import of JS scripts I've been working on integrating Bootstrap with my custom reusable web components across all pages. Specifically, I&apo ...

Guide to triggering a popover from within another popover using jQuery

Currently, I have a situation where a popover is triggered by clicking on a button. The goal is to trigger another popover from the first popover by clicking on some content within it. If you'd like to see a demonstration, check out this JSFiddle lin ...

Scrolling to does not function properly with Material UI tabs

Looking for a solution to scroll to a specific div when clicking on a tab in Material UI Tabs using UseRef and ScrollTo. Check out the sandbox link here: https://codesandbox.io/s/exciting-sound-mrw2v Currently, when I click on Tab 2, I expect it to autom ...

Display a div every 3 seconds with the help of jQuery

I am seeking a solution to display the second div (box2) every 3 seconds. Can anyone help me achieve this using jQuery? <div id="box1" style="background-color:#0000FF"> <h3>This is a heading in a div element</h3> <p>This ...

Issues arise when dealing with a CSS and HTML accordion

I decided to create a CSS and HTML collapsing menu system, also known as an accordion. I found a tutorial on how to do it here. However, I had to make some modifications because I wanted to include images in the 'sections' later on. Instead of us ...

form data was not successfully submitted

I'm facing an issue with sending posts in codeigniter. After reading other posts, I tried setting the variable max_input_vars = 1000, but unfortunately, the data is not being sent. The resulting html code is as follows: <form id="0" action="CO_con ...

loop not functioning properly with file type input

Having trouble uploading an image and copying it into a folder named images within a loop. Can you assist with solving this issue? Here's my code: $sql="SELECT * FROM product"; $q=$conn->query($sql); while($r=$q->fetch(PDO::FETCH_ASSOC)) { $cod ...

How to show a div for small screens only using Bootstrap 4 beta?

Previously, in Bootstrap alpha 6 I was able to achieve this by writing the following code for displaying a div's contents only for sm: <div class="hidden-md-up hidden-xs-down"> This content would only be visible for sm in Bootstrap 4 alpha 6 ...

Integrate jQuery into a Vue.js 2 project using the expose-loader plugin

For my latest Vue.js project using the vue-cli, I attempted to import jQuery with expose-loader. Following the instructions in the official documentation, but unfortunately, I was not successful. Here are the steps I took: Installed jQuery and expose- ...

The Cascading of Bootstrap Card Designs

Looking for some assistance with my TV Show Searcher project that is based on an API. The functionality is complete, but I'm struggling to get the Bootstrap cards to stack neatly without any empty space between them. I want it to resemble the image ga ...

Differences between Bootstrap-5 CSS files and SCSS files

As I delve into the world of Bootstrap, I recently utilized npm to install Bootstrap and discovered that there are both CSS and SCSS files under node_modules. My understanding of SCSS is that it is a more advanced version of CSS, leading me to question t ...

Customize the velocity of your jQuery Cycle plugin's horizontal slider

Currently, I am utilizing the jQuery Cycle plugin to design a basic slideshow. Here is the corresponding script: $(document).ready(function() { var slideshow = $('#slider').cycle({ fx: 'scrollHorz', speed: 500, timeout: ...

Change the color of the border to match the background color

I have a parent container with a unique background color. Inside the parent container, there is an unordered list (ul) with multiple list items (li), each having a distinct color and a brighter border color. Now, I am looking to extract the border color of ...

What is causing the background image to not display within my <div>?

I want to add a background image to only a specific part of my website, using the image as an id called "fruit." However, the image is not showing up. Here is the code I have: <div class="p-1 text-center bg-light" id="fruit"> &l ...

What is the best location to store the JWT bearer token?

Exploring options for storing JWT tokens in a Bearer header token for my application. Looking for the most efficient storage mechanism. Would love some insight on how to accomplish this using jQuery. Any recommendations for a secure method? ...

angular 2 checkbox for selecting multiple items at once

Issue I have been searching for solutions to my problem with no luck. I have a table containing multiple rows, each row having a checkbox. I am trying to implement a "select all" and "deselect all" functionality for these checkboxes. Below is an example o ...

The Django form isn't displaying properly after being imported into the HTML file

Can anyone help me figure out why my Django form isn't appearing in my HTML template? I've tried everything on this site and nothing seems to work. Any suggestions? views.py def handleForm(request): context = {} if request.method == &apo ...

Expandable Checkout Form for Woocommerce

I need help troubleshooting a WooCommerce collapsible checkout form using Bootstrap Collapse. Below is the HTML markup I am currently using: <div class="panel-group" id="checkout-accordion"> <div class="panel panel-default" id="panel-billing"&g ...