I am creating a website similar to a text editor for my university project using Bootstrap as a framework. I have used the dynamic tabs in order to create the menus for the website. This is the code I hasve:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI-Assistant Writing Tool</title>
<!--Bootstrap styling import-->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="HomeStyle.css">
</head>
<body>
<!--Creation of the dynamic tabs-->
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link px-4" id="file-tab" data-bs-toggle="tab" data-bs-target="#file-tab-pane" type="button" role="tab" aria-controls="file-tab-pane" aria-selected="false">File</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link active px-4" id="home-tab" data-bs-toggle="tab" data-bs-target="#home-tab-pane" type="button" role="tab" aria-controls="home-tab-pane" aria-selected="true">Home</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link px-4" id="edit-tab" data-bs-toggle="tab" data-bs-target="#edit-tab-pane" type="button" role="tab" aria-controls="edit-tab-pane" aria-selected="false">Edit</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link px-4" id="layout-tab" data-bs-toggle="tab" data-bs-target="#layout-tab-pane" type="button" role="tab" aria-controls="layout-tab-pane" aria-selected="false">Layout</button>
</li>
</ul>
<div class="tab-content border border-1" id="myTabContent">
<!--Content in the file tab-->
<div class="tab-pane fade" id="file-tab-pane" role="tabpanel" aria-labelledby="file-tab" tabindex="0">...</div>
<!--Content in the home tab-->
<div class="tab-pane fade show active d-flex justify-content-center my-2" id="home-tab-pane" role="tabpanel" aria-labelledby="home-tab" tabindex="0">
<div class="d-flex align-items-center overflow-auto gap-1">
<button type="button" class="btn" id="boldButton" data-bs-toggle="button"><b>B</b></button>
<button type="button" class="btn" id="italicsButton" data-bs-toggle="button"><i>I</i></button>
<button type="button" class="btn" id="underlineButton" data-bs-toggle="button"><u>U</u></button>
<select class="ms-5" name="font" id="font">
<option value="times-new-roman">Times New Roman</option>
<option value="helvetica">Helvetica</option>
<option value="garamond">Garamond</option>
<option value="calibri">Calibri</option>
<option value="arial">Arial</option>
</select>
<button type="button" class="btn" id="increaseFontSize">Size△</button>
<button type="button" class="btn me-5" id="decreaseFontSize">Size▽</button>
<button type="button" class="btn" data-bs-toggle="button">Left Align</button>
<button type="button" class="btn" data-bs-toggle="button">Centre Align</button>
<button type="button" class="btn" data-bs-toggle="button">Right Align</button>
<button type="button" class="btn" data-bs-toggle="button">Justify</button>
<select name="spacing" id="spacing">
<option value="" disabled selected>Line Spacing</option>
<option value="0.5">0.5</option>
<option value="1">1</option>
<option value="1.5">1.5 (Default)</option>
<option value="2">2</option>
<option value="2.5">2.5</option>
</select>
<button type="button" class="btn ms-5">Bulleted List</button>
<button type="button" class="btn">Numbered List</button>
</div>
</div>
<!--Content in the edit tab-->
<div class="tab-pane fade d-flex justify-content-center my-2" id="edit-tab-pane" role="tabpanel" aria-labelledby="edit-tab" tabindex="0">
<div class="d-flex align-items-center overflow-auto gap-1">
<button type="button" class="btn">Undo</button>
</div>
</div>
<!--Content in the layout tab-->
<div class="tab-pane fade" id="layout-tab-pane" role="tabpanel" aria-labelledby="layout-tab" tabindex="0">...</div>
</div>
<div class="text-area d-flex justify-content-center my-5">
<div id="input" contenteditable="true"></div>
</div>
<!--Bootstrap js import-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="HomeJava.js"></script>
</body>
</html>
However, when I view the webpage the tabs work fine, but switching from the home to the edit tab, the button within the edit tab stacks below within the div, as if the buttons from the home tab are still there, they are just invisible. Adding anymore buttons within a different tab (layout for example), will then stack that below the button in the edit tab. This is what it looks like:
I have tried removing my own stylesheet and JS code, changing from a list to div elements, changing them from buttons to links to the their individual div elements but nothing is working.

