Issue with positioning Bootstrap dropdown
I recently encountered a problem where I placed a bootstrap dropdown inside a div that centers the dropdown using CSS "text-align: center", but the dropdown menu still appeared in its original position. It seems like the dropdown doesn't recognize that its triggering button has been moved.
To see the problem for yourself, check out this jsfiddle:
https://jsfiddle.net/dkent600/wyos4ukt
The provided code snippet is as follows:
<div style="background-color:grey; text-align:center">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
Dropdown
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
</ul>
</div>
</div>
If you have any tips or suggestions on how to resolve this issue, please let me know. Thank you!