Answer the question
In order to leave comments, you need to log in
How to move dropdown-menu to another block?
Suppose there is such a block
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
Answer the question
In order to leave comments, you need to log in
in version 4 you can use data-toggle="collapse" for this, just replace dropdown with collapse.
And if you need data-toggle="dropdown", then you have to wrap it in a single div.
What is it for you? It just seems to me that this is superfluous if you want to implement some kind of animation to display the block with links itself. It can be done like this too.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question