2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-30 15:24:08 +03:00

allow <button> elements as .dropdown-item's

This commit is contained in:
Mark Otto
2015-08-17 18:18:37 -07:00
parent f6925475dc
commit 29b4031db5
2 changed files with 25 additions and 0 deletions
+19
View File
@@ -28,6 +28,25 @@ Wrap the dropdown's trigger and the dropdown menu within `.dropdown`, or another
</div>
{% endexample %}
### Button elements
You can optionaly use `<button>` elements in your dropdowns instead of `<a>`s.
{% example html %}
<div class="dropdown open">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu1">
<button class="dropdown-item" type="button">Action</button>
<button class="dropdown-item" type="button">Another action</button>
<button class="dropdown-item" type="button">Something else here</button>
</div>
</div>
{% endexample %}
## Alignment
By default, a dropdown menu is automatically positioned 100% from the top and along the left side of its parent. Add `.dropdown-menu-right` to a `.dropdown-menu` to right align the dropdown menu.