0
I’m trying to fix a div with a title, below a fixed navbar at the top of the screen. Below is my attempt and example that does not work:
<body>
<header class="sticky-top">
<nav class="navbar navbar-expand-md navbar-dark menu-superior">
<!-- Menu -->
MENU
</nav>
</header>
<!-- CORPO-->
<main class="container-fluid p-0 pr-sm-3 pl-sm-3">
<!-- TITULO QUE QUERO FIXAR -->
<div class="sticky-top tilte text-center font-weight-bold">
<h5>Título</h5>
</div>
<!-- CONTEÚDO ... -->
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
</main>
</body>
Does anyone know how to do it? If you run the above example with Bootstrap 4, you’ll see that when I scroll down, the title div overrides the navbar above it. And my expected result is that they both stay fixed.
Follow the example running: https://jsfiddle.net/ataufo/6emxzL9y/3/
What would be the problem?
– Sam
I edited and explained what happens. I also put a link with the example running.
– Victor Soares