I am currently using Bootstrap 4 to craft a navigation menu. Each navigation item features a dropdown menu that I want to display centered horizontally on the page, with the same size as the ul element. However, due to my limited experience with Bootstrap, I am struggling to achieve this desired outcome.
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<nav class="navbar navbar-expand-md navbar-light bg-primary py-0">
<div class="container h-100">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse h-100" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto mx-auto h-100">
<li class="nav-item dropdown px-2">
<a class="nav-link dropdown-toggle text-white" href="/category/flat-roof-materials" id="flatRoofingDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Flat Roofing
</a>
<div class="dropdown-menu border border-primary row mx-auto" aria-labelledby="flatRoofingDropdown">
<div class="container">
<div class="row">
<div class="col-md-4">
...
</div>
<div class="col-md-4">
...
</div>
<div class="col-md-4">
...
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</nav>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
Current situation:
https://i.sstatic.net/sV5Om.png
Desired outcome, centered and equal size:
https://i.sstatic.net/V8TTT.png
Result from suggested solution: