My issue involves two fixed-top navbars, where the dropdown-menu from the first one is being overlapped by the second navbar. I've tried adjusting z-index, positioning, and overflow properties without success. I have also looked at similar questions but haven't found a solution yet. Any suggestions on what might be causing this problem?
For reference, you can view my code on FIDDLE
Here's an image demonstrating the problem (2nd navbar overlapping dropdown-menu):
https://i.sstatic.net/WR0d3.png
Here is an example of the code:
<!DOCTYPE html>
<html>
<head>
<meta>
<title>Navbar overlapping dropdown-menu</title>
<!-- Bootstrap 4 cdn's & jquery dependency -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</head>
<body>
<!-- first navbar with dropdown-menu -->
<nav class="navbar bg-dark fixed-top navbar-expand-sm">
<div class="collapse navbar-collapse">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"> Dropdown </a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#"> 1 </a>
<a class="dropdown-item" href="#"> 2 </a>
<a class="dropdown-item" href="#"> 3 </a>
<a class="dropdown-item" href="#"> 4 </a>
</div>
</li>
</ul>
</div>
</nav>
<!-- second navbar with top offset -->
<nav class="navbar bg-primary fixed-top navbar-expand-sm" style="top:56px!important;">
<p>hello world</p>
</nav>
</body>
</html>