I have a similar query to the one discussed in this thread, but my goal is to utilize bootstrap's flex
feature for achieving a "dynamic" height
for the tab-content
. The code snippet below results in a scrollbar encompassing the entire page, whereas I specifically desire the content within the tab-pane
to be scrollable (internal scrollbar).
Edit II: The tab-content
should occupy the remaining available space. Initially, I assumed that applying flex-grow-1
to the tab-content
alongside h-100
on the tab-pane
would yield the desired outcome. However, this approach did not materialize as expected.
I appreciate any guidance or recommendations provided.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<title>Title</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"
integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"
integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm"
crossorigin="anonymous"></script>
</head>
<body>
<div class="d-flex flex-row" style="min-height: 100vh; max-height: 100vh;">
<div class="d-flex flex-column flex-grow-1">
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist"
<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab"
aria-controls="nav-home" aria-selected="true">Home</a>
</div>
</nav>
<div class="tab-content flex-grow-1" id="nav-tabContent">
<div class="tab-pane fade show active d-flex flex-column h-100" id="nav-home" role="tabpanel"
aria-labelledby="nav-home-tab">
<div class="flex-grow-1" style="overflow-y: scroll">
<p>Ethical Kickstarter PBR asymmetrical lo-fi. Dreamcatcher street art Carles, stumptown
gluten-free Kickstarter artisan Wes Anderson wolf pug. Godard sustainable you probably haven't heard of them, vegan
farm-to-table
Williamsburg slow-carb readymade disrupt deep v. Meggings seitan Wes Anderson semiotics,
cliche American
Apparel whatever. Helvetica cray plaid, vegan brunch Banksy leggings +1 direct trade.
Wayfarers codeply
PBR
selfies. Banh mi McSweeney's Shoreditch selfies, forage fingerstache food truck occupy YOLO
Pitchfork
fixie
iPhone fanny pack art party Portland.
Ethical Kickstarter PBR asymmetrical lo-fi. Dreamcatcher street art Carles, stumptown
gluten-freelt;
</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>