Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
29b4031d
Commit
29b4031d
authored
Aug 17, 2015
by
Mark Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow <button> elements as .dropdown-item's
parent
f6925475
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
docs/components/dropdowns.md
docs/components/dropdowns.md
+19
-0
scss/_dropdown.scss
scss/_dropdown.scss
+6
-0
No files found.
docs/components/dropdowns.md
View file @
29b4031d
...
...
@@ -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.
...
...
scss/_dropdown.scss
View file @
29b4031d
...
...
@@ -65,6 +65,12 @@
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment