Bootstrap drop-down menu (dropdowns)
The drop-down menu is switchable and is a contextual menu that displays links in list format. To use the menu below, simply add a drop-down menu to the class . Dropdown .
A. The code example is as follows:
<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "Utf-8"/> <title>Bootstrap instance-drop-down menu (dropdowns)</title> <Linkhref= "Http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css"rel= "stylesheet"> <Scriptsrc= "Http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></Script> <Scriptsrc= "Http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></Script></Head><Body><Divclass= "Dropdown"> <Buttontype= "button"class= "btn btn-md dropdown-toggle"ID= "DropdownMenu1"Data-toggle= "Dropdown">Theme<spanclass= "Caret"></span> </Button> <ulclass= "Dropdown-menu"role= "Menu"Aria-labelledby= "DropdownMenu1"> <Lirole= "Presentation"> <arole= "MenuItem"TabIndex= "-1"href="#">Java</a> </Li> <Lirole= "Presentation"> <arole= "MenuItem"TabIndex= "-1"href="#">Data mining</a> </Li> <binrole= "Presentation"> <arole= "MenuItem"TabIndex= "-1"href="#">data communication/Networking</a> </Li> <Lirole= "Presentation"class= "Divider"></Li> <Lirole= "Presentation"> <arole= "MenuItem"TabIndex= "-1"href="#">Detached links</a> </Li> </ul></Div></Body></HTML>
B. Effects
C. Alignment
Align the drop-down menu to the right by adding class . pull-right to the . Dropdown-menu .
Such as:
<classpull-right" role=" Menu " Aria-labelledby= "dropdownMenu1">
D. title
You can add a caption using the label area of the class Dropdown-header drop-down menu
Such as:
<role= "Presentation" class= "Dropdown-header"> Drop-down menu title </li>
Effects such as:
Bootstrap Basic Learning 11 articles