Bootstrap drop-down menu (dropdowns) and buttons

Source: Internet
Author: User

1. Drop-down menu

<div class= "dropdown" >
   <button type= "button" class= "btn dropdown-toggle" id= " 
      dropdownMenu1" data-toggle= "dropdown" >
      theme
      <span class= "caret" ></span>//set down the small triangle
   </button>
   <ul class= "Dropdown-menu" role= "menu" aria-labelledby= "dropdownMenu1" >
      <li role= "Presentation" >
         <a role= "MenuItem" tabindex= "-1" href= "#" >Java</a>
      </li>
      <li role= " Presentation ">
         <a role=" MenuItem "tabindex="-1 "href=" # "> Data Mining </a>
      </li>
           < Li role= "presentation" class= "divider" ></li>//set a split line
      <li role= "Presentation" >
         <a role = "MenuItem" tabindex= "-1" href= "#" > Detached links </a>
      </li>
   </ul>
</div>

2. Add drop-down menu title

<li role= "Presentation" class= "Dropdown-header" > drop-down menu title </li>

3. Button Group

. Btn-group: Forms a basic group of buttons
. Btn-toolbar: Combine several button groups
. Btn-group-lg,.btn-group-sm,.btn-group-xs: Adjustment
of the entire button group size . btn-group-vertical: Vertical stacking of buttons instead of horizontally stacked display
Button group, three buttons on one line display
<div class= "Btn-group" >
  <button type= "button" class= "btn Btn-default" > button 1 </button>
  <button type= "button" class= "btn btn-default" > button 2</button> <button
  type= " Button "class=" btn btn-default "> button 3</button>
</div>
//button on one line, three for a group <div class= "Btn-toolbar" role= "Toolbar" > <div class= "Btn-group" > <button type= "button" class= "btn btn-default" > button 1</button> <button type= "button" class= "Btn btn-d Efault "> button 2</button> <button type=" button "class=" btn btn-default "> button 3</button> </div> & Lt;div class= "Btn-group" > <button type= "button" class= "btn btn-default" > button 4</button> <button type= " Button "class=" btn btn-default "> button 5</button> <button type=" button "class=" btn btn-default "> button 6</ Button> </div> </div> 
Button nesting
<div class= "Btn-group" >//Large Group of buttons
  <button type= "button" class= "btn btn-default" > button 1</ button>
  <button type= "button" class= "btn btn-default" > button 2</button> <div class=

  "Btn-group ">//Nested small button group
    <button type=" button "class=" btn btn-default dropdown-toggle " 
      data-toggle=" dropdown " >//drop-down menu the
      following
      <span class= "caret" ></span>//Display black small triangle
    </button>
    <ul class= " Dropdown-menu ">
      <li><a href=" # "> Lower zipper 1</a></li>
      <li><a href=" # "> Under Zipper 2</a></li>
    </ul>
  </div>
</div>

4. Split button drop-down menu

<div class= "Btn-group" >
   <button type= "button" class= "btn Btn-default" > Default </button>//First define a normal button , the display text is the default
   <button type= "button" class= "btn btn-default dropdown-toggle" 
      data-toggle= "dropdown" >// Define a button that appears as a black small triangle
      <span class= "caret" ></span>
      <span class= "sr-only" > Toggle drop-down menu </span>
   </button>
   <ul class= "Dropdown-menu" role= "menu" >//drop-down menu contents
      <li><a href= "#" > function </a></li>
      <li><a href= "#" > Another feature </a></li>
      <li><a href= "#" > Other </a></li>
      <li class= "divider" ></li>
      <li><a href= "#" > Detached links </a></li>
   </ul>
</div>

5. button Pull-up menu
Add the. Dropup in the. Btn-group container.

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.