Intersection of content in panel-body using bootstrap tab pills

Can someone help me solve a major issue? I need the content of each tab to overlap as if they are unaware of each other. Currently, my code is saved in this fiddle: https://jsfiddle.net/axq882de/1/. When I click on different tabs, the contents should remain in the same position.

<div class="container">
<div class="row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">The Projects</div>

<ul class="nav nav-tabs" id='nav-wrapper'>
        <li id='nav-overview' class="active"><a data-toggle="pill" href="#overview">Overview</a></li>
        <li id='nav-text'><a data-toggle="pill" href="#text">Text</a></li>
        <li id='nav-rules'><a data-toggle="pill" href="#rules">Rules</a></li>
    </ul> 
            <div id="wrapper" class="panel-body m100">
            <div id='overview' class="tab-pane fade in active">
            Name: Elsor <br>
            Employees: LukvonStrom tempralino&nbsp;Pop3y&nbsp;Chkarist&nbsp;M4st3mM4yh3m&nbsp;localhost2148&nbsp;Chrzi <br>
            <p id="id" style="margin-bottom: 1.3em; font-size: 14px; line-height: 21px;">
            <iframe src="https://map.die-bruderschaft.org?worldname=world&amp;mapname=surface2&amp;zoom=5&amp;x=1036&amp;y=64&amp;z=-517" width="500px" height="500px"></iframe></p>
            </div>
                <div id='text' class="tab-pane fade">
                <p> Elsor is the spawn and main city of the server </p><br>
                </div>
                <div id='rules' class="tab-pane fade">
                <p> Only one free plot and one purchased plot per user allowed. The plot boundary can only be removed but not built upon at the entrance area, except for the roof, which may overlap. The house must adhere to the city's building style, and immediate changes are required upon warning. Free plots can be easily developed and must be restored to their original state upon vacating. Non-free plots can be acquired from a team member. For shared accommodations, an additional 500 Dz per resident is charged. Moving is only possible to an equal or larger plot and incurs the difference in plot prices plus a 1000 Dz relocation fee. In case of inactivity without notice, the house will be demolished (Purchased plots: 4 weeks, Free plots: 2 weeks). Only the ground and mezzanine floor can be altered in shops. Changes to external walls and roofs are prohibited. Shops must be acquired from a team member. In case of inactivity without notice, expropriation occurs after 4 weeks.  </p><br>
                </div>
          </div>
        </div>
    </div>
</div>

Thank you for taking the time to answer this question and saving me valuable time :)

Answer №1

Insert this CSS

.panel.with-nav-tabs .panel-heading{
    padding: 5px 5px 0 5px;
}
/********************************************************************/
/*** PANEL DEFAULT ***/
.with-nav-tabs.panel-default .nav-tabs > li > a,
.with-nav-tabs.panel-default .nav-tabs > li > a:hover,
.with-nav-tabs.panel-default .nav-tabs > li > a:focus {
    color: #777;
}
.with-nav-tabs.panel-default .nav-tabs > .open > a,
.with-nav-tabs.panel-default .nav-tabs > .open > a:hover,
.with-nav-tabs.panel-default .nav-tabs > .open > a:focus,
.with-nav-tabs.panel-default .nav-tabs > li > a:hover,
.with-nav-tabs.panel-default .nav-tabs > li > a:focus {
    color: #777;
    background-color: #ddd;
    border-color: transparent;
}
.with-nav-tabs.panel-default .nav-tabs > li.active > a,
.with-nav-tabs.panel-default .nav-tabs > li.active > a:hover,
.with-nav-tabs.panel-default .nav-tabs > li.active > a:focus {
    color: #555;
    background-color: #fff;
    border-color: #ddd;
    border-bottom-color: transparent;
}
.with-nav-tabs.panel-default .nav-tabs > li.dropdown .dropdown-menu {
    background-color: #f5f5f5;
    border-color: #ddd;
}
.with-nav-tabs.panel-default .nav-tabs > li.dropdown .dropdown-menu > li > a {
    color: #777;   
}
.with-nav-tabs.panel-default .nav-tabs > li.dropdown .dropdown-menu > li > a:hover,
.with-nav-tabs.panel-default .nav-tabs > li.dropdown .dropdown-menu > li > a:focus {
    background-color: #ddd;
}
.with-nav-tabs.panel-default .nav-tabs > li.dropdown .dropdown-menu > .active > a,
.with-nav-tabs.panel-default .nav-tabs > li.dropdown .dropdown-menu > .active > a:hover,
.with-nav-tabs.panel-default .nav-tabs > li.dropdown .dropdown-menu > .active > a:focus {
    color: #fff;
    background-color: #555;
}

Next, use the following HTML structure

<div>
<div class="col-md-6">
            <div class="panel with-nav-tabs panel-default">
                <div class="panel-heading">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tab1default" data-toggle="tab">Default 1</a></li>
                            <li><a href="#tab2default" data-toggle="tab">Default 2</a></li>
                            <li><a href="#tab3default" data-toggle="tab">Default 3</a></li>
                            <li class="dropdown">
                                <a href="#" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="#tab4default" data-toggle="tab">Default 4</a></li>
                                    <li><a href="#tab5default" data-toggle="tab">Default 5</a></li>
                                </ul>
                            </li>
                        </ul>
                </div>
                <div class="panel-body">
                    <div class="tab-content">
                        <div class="tab-pane fade in active" id="tab1default">Default 1</div>
                        <div class="tab-pane fade" id="tab2default">Default 2</div>
                        <div class="tab-pane fade" id="tab3default">Default 3</div>
                        <div class="tab-pane fade" id="tab4default">Default 4</div>
                        <div class="tab-pane fade" id="tab5default">Default 5</div>
                    </div>
                </div>
            </div>
        </div>
</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

Detect the 'enter' key press in a contenteditable <li> element while typing

I am working with the following snippet of HTML code: <li class="option-item new" contenteditable="true">simple element2</li> My goal is to exit editing mode (set contentEditable to false) when the ENTER key is pressed, rather than inserting ...

Exploring the depths of HTML 5, harnessing the power of

As I embark on a new website project, I am excited to incorporate HTML5 for a fresh and dynamic look. To address potential compatibility issues with Internet Explorer, I have decided to utilize the resources provided by the HTML5 Boilerplate project. In m ...

Is there a method to automatically refresh all active webpages as my Firebase Realtime database accumulates new data?

With the power of Firebase, I created a chatroom using HTML that saves all its data, including usernames and messages, in a real-time Firebase database. The chatroom currently displays sent messages upon manual page reloads or when a new message is sent, ...

Steps for troubleshooting a Jquery Dialog

My current jQuery dialog maker is working in most places, but I'm encountering issues when trying to use it for the third time. In this instance, after the dialog is displayed, the form fields become disabled. The core idea behind the code is that th ...

Ways to prevent hidden fields from being submitted in a form?

When submitting my HTML form, the hidden elements with display:none are also being posted. How can I prevent this from happening? ...

Position the personalized radio button to be in line with the first choice text

I frequently update this section with a new Jsfidle link to demonstrate the issue when the max-width is set to 300px. For responsive design, adding the "span" tag before radio buttons helps align input content with custom checkbox backgrounds. To see the ...

Update the jQuery Mobile components on the page by refreshing them after dynamically adding them using AJAX and PHP

I have developed a PHP script that dynamically renders three form elements for each entry in a database. The script generates HTML output similar to the following example: <!-- Entry 1 --> <div data-role="fieldcontain"> < ...

Discover music with Grooveshark-inspired search result filters

On my website, there is a table populated from the database. I want to make it filter dynamically as the user enters a keyword in the search box. A similar feature can be seen on Grooveshark.com How should I go about implementing this function? ...

Stop material button from animating when clicked

On my webpage, I have created a unique button structure using Angular Material design: <button mat-button class="library-tile-button"> <button mat-button class="edit-library-button"> <img class="edit-library-img" src="..."/> ...

What is causing the slideDown animation to initially transition into slideUp animation?

When I click a button, I am adding some new results. I am using the slideDown method to display these results, but for some reason, they first slide up and then down again. Additionally, when I remove the added results, they instantly disappear without any ...

Encountering an issue where an error message indicates that a variable previously declared is now undefined

Currently, I am working on developing a small test application to enhance my coding skills. However, I have encountered a roadblock while attempting to display dummy information from a mongodb database that I have set up. I have tried various solutions bu ...

Display the PrimeFaces dialog in the middle of the screen

I've encountered an issue with positioning dialogs on different pages. I tried using a CSS code to center them on the screen, but it didn't work as expected. .ui-dialog{ position: fixed; top: 50%; left: 50%; margin-top: -50px; ...

Issue with rendering images on Bootstrap-Vue card component

In the process of creating a static website with Vue.js, I am attempting to incorporate a basic Bootstrap card using Bootstrap-Vue. Unfortunately, I am facing an issue where the image does not display when utilizing the b-card component with the img attrib ...

Creating an iPad-inspired password field experience in a text input with jquery: A step-by-step guide

Looking for a plugin that mimics the iPad's password field behavior for credit card number entry. The focus should only reveal the entered digit and then switch to a bullet as the next digit is typed. Additionally, all previously entered digits should ...

Preventing clicks within an iframe

Within an iframe, I have HTML content that includes hyperlinks. I need to prevent clicks on these hyperlinks. I managed to accomplish this using jQuery as shown below. However, I prefer not to use jQuery for this task. How can I achieve the same result ...

Guide to displaying or hiding elements based on the number of selected checkboxes

When only one checkbox is checked, all buttons in the head-btn class should be displayed. By default, only the add folder and upload buttons are shown. If a user selects two checkboxes, the share button should be hidden. If they uncheck one of the checkbo ...

How to choose elements using jQuery according to their CSS properties?

Seeking a solution to a unique challenge I've encountered. The website I frequent has found a way to bypass my uBlock extension by using a script that generates random element classes, such as: <div class="lcelqilne1471483619510ttupv"></div& ...

Unexpected issue with codebehind not being invoked by ajax

Within this code snippet, there is a dropdown menu that is intended to trigger a method in the backend when a value is selected. However, the dropdown is not currently functioning as expected. The goal is to make the dropdown menu dependent on selecting an ...

Using jQuery to dynamically add one of two fields to a form

After successfully using JQuery to add a field to a form, I am now stuck on how to implement two add field buttons for adding different fields. Can anyone point me in the right direction? <html> <head> <title>jQuery add / remove textb ...

Finding the dynamic width of a div using JavaScript

I have two divs named demo1 and demo2. I want the width of demo2 to automatically adjust when I drag demo1 left to right or right to left. <div class="wrapper"> <div class="demo"></div> <div class="demo2"&g ...