]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
allow <button> elements as .dropdown-item's
authorMark Otto <markdotto@gmail.com>
Tue, 18 Aug 2015 01:18:37 +0000 (18:18 -0700)
committerMark Otto <markdotto@gmail.com>
Tue, 18 Aug 2015 01:18:37 +0000 (18:18 -0700)
docs/components/dropdowns.md
scss/_dropdown.scss

index c60cb6fdbb17e5c597309ad41f79c48f62aa0c01..8b1ae7a67b390358b1d3198a43101914ba6b7cac 100644 (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.
index 734efbb0b00dfaf5e96ad3d4edf1d6d0848839f9..4ee6674e532b42b70631a9caa48ea234e6fcbac9 100644 (file)
   color: $dropdown-link-color;
   white-space: nowrap; // prevent links from randomly breaking onto new lines
 
+  // For `<button>`s
+  text-align: inherit;
+  width: 100%;
+  background: none;
+  border: 0;
+
   @include hover-focus {
     color: $dropdown-link-hover-color;
     text-decoration: none;