Can anyone help me with an issue regarding a navigation bar and content created in Bootstrap 5? I'm trying to use vh-100
to make both the navigation bar and content stay on the view page without a scrollbar. However, the size of the navigation bar is causing the content to be pushed below it. How can I ensure that both elements remain visible even when zoomed in?
This is what I've tried so far:
https://jsfiddle.net/daxejno5/
.bg-darkblue{
background-color: #ccc;
}
#test{
overflow-y: scroll;
overflow-x: hidden;
}
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="99fbf6f6edeaedebf8e9d9acb7a8b7aa">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light p-0 bg-darkblue">
<div class="container-fluid">
<a class="navbar-brand text-light" href="/">Test</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
</ul>
</div>
</div>
</nav>
<div class="col-sm-9 p-0">
<div class="card rounded-0 vh-100">
<div id="test" class="card-body p-0 d-flex flex-column-reverse">
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Voluptatum ipsum vero saepe accusamus magnam nemo consectetur voluptas quidem similique mollitia repudiandae quam voluptatibus, maiores hic! Rerum unde consequatur a aliquid.
<!-- more lorem ipsum content -->
</div>
<div class="card-footer text-muted">
<form id="test-form" class="m-0">
<div class="row">
<div class="col">
<input type="text" class="form-control rounded-pill" autocomplete="off" placeholder="Type something...">
</div>
</div>
</form>
</div>
</div>
</div>
<!-- closing body and html tags -->