Bootstrap Basic Learning 11 articles

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.