You need to wrap the drop-down menu trigger and drop- .dropdown down menu in, or another position: relative; declared element.
<div class= "dropdown" > <button class= "btn btn-default dropdown-toggle" type= "button" id= "DropdownMenu1" Data-toggle= "dropdown" aria-haspopup= "true" aria-expanded= "true" > dropdown <span class= "Caret" > </span> </button> <ul class= "Dropdown-menu" aria-labelledby= "dropdownMenu1" > < Li><a href= "#" >Action</a></li> <li><a href= "#" >another action</a>< /li> <li><a href= "#" >something else here</a></li> <li><a href= "#" >separated link</a></li> </ul></div>
- Pop up: First line replaced
.dropup by class
- Right Justification: for
.dropdown-menu adding .dropdown-menu-right
分割线:<li role="separator" class="divider"></li>
禁用:<li class="disabled"><a href="#">Disabled link</a></li>
标题:<li class="dropdown-header">Dropdown header</li>
Bootstrap about the use of drop-down menus