I am currently developing a navigation bar using Bootstrap 4. Here is the code I have so far:
<div class="row mx-2">
<div class="dropdown">
<div class="btn btn-info dropdown-toggle" data-toggle='dropdown'>
Option 1
</div>
<div class='dropdown-menu'>
<div class='dropdown-item' style="cursor:pointer;" onclick="dosomething()">
DDO11
</div>
<a href="abc.php" class='dropdown-item'>DDO12</a>
</form>
</div>
</div>
<div class="dropdown">
<div class="btn btn-info dropdown-toggle mx-3" data-toggle='dropdown'>
Option 2
</div>
<div class='dropdown-menu'>
<div class='dropdown-item' style="cursor:pointer;" onclick="dosomething()">DDO21</div>
<div class='dropdown-item' style="cursor:pointer;" onclick="dosomething()">DDO22</div>
</div>
</div>
<div class="btn btn-dark col mx-2" onclick="dosomething()">Option3</div>
<div class="dropdown">
<div class="btn btn-info dropdown-toggle" data-toggle='dropdown'>
Option 4
</div>
<div class='dropdown-menu'>
<div class='dropdown-item' style="cursor:pointer;" onclick="dosomething()">DDOP41</div>
</div>
</div>
<div class="btn btn-dark col mx-2"><a href='ABC.php' style="text-decoration:none;color:#fff;">Option 5</a></div>
</div>
The challenge I am facing is to ensure that all the buttons in the navigation bar have uniform widths. The dropdown buttons are currently resizing based on the text content, while the non-dropdown buttons are taking up excess space. I have attempted to set width:20% and utilize col-*-* on the parent buttons, but these solutions have not produced the desired outcome.
Do you have any suggestions on how to achieve consistent button widths throughout the navigation bar?