开发手册 欢迎您!
软件开发者资料库

Bootstrap - 按钮下拉菜单

Bootstrap按钮下拉菜单 - 从概述,环境设置,基本结构,全局样式,网格系统,流体网格系统,布局,响应式设计,排版,表格,按钮,图像,图标,下拉列表,按钮开始,简单易学地学习Bootstrap组,导航元素,导航栏,面包屑,分页,标签,徽章,版式,缩略图,警报,进度栏,媒体对象,Javascript插件像过渡,模态,下拉列表,Scrollspy,选项卡,工具提示,弹出,警报,按钮,折叠, Carousel,Typeahead,Affix,Glyphicons,Jumbotron,Demos。

本章将讨论如何使用Bootstrap类向按钮添加下拉菜单.要向按钮添加下拉列表,只需将按钮和下拉菜单包装在 .btn-group 中.您还可以使用< span class ="caret">作为按钮是下拉列表的指示器.

以下示例演示了基本的单按钮下拉菜单:

            Default                      
  • Action
  •       
  • Another action
  •       
  • Something else here
  •                   
  • Separated link
  •    
             Primary                      
  • Action
  •       
  • Another action
  •       
  • Something else here
  •                   
  • Separated link
  •       

    Split Button Dropdowns

    拆分按钮下拉菜单使用与下拉按钮相同的常规样式,但添加主要操作以及下拉列表。 拆分按钮的左侧是主要操作,右侧是切换按钮,显示下拉列表。

       Default                  Toggle Dropdown               
  • Action
  •       
  • Another action
  •       
  • Something else here
  •                   
  • Separated link
  •       Primary                  Toggle Dropdown               
  • Action
  •       
  • Another action
  •       
  • Something else here
  •                   
  • Separated link
  •    

    Button Dropdown Size

    您可以使用任何按钮大小和减号的下拉菜单; .btn-large,.btn-sm或.btn-xs。

                Default                     
  • Action
  •       
  • Another action
  •       
  • Something else here
  •                   
  • Separated link
  •             Primary                     
  • Action
  •       
  • Another action
  •       
  • Something else here
  •                   
  • Separated link
  •             Success                     
  • Action
  •       
  • Another action
  •       
  • Something else here
  •                   
  • Separated link
  •       

    Dropup Variation

    菜单也可以构建为下降而不是下降.要实现此目的,只需将 .dropup 添加到父 .btn-group 容器中.

                         Default                                    
  • Action
  •          
  • Another action
  •          
  • Something else here
  •                            
  • Separated link
  •                               Primary                                    
  • Action
  •          
  • Another action
  •          
  • Something else here
  •                            
  • Separated link
  •