1. bootstrap按钮

    • 对应链接:http://v3.bootcss.com/css/#buttons
    • 使用时添加基础类class:btn
    • 默认样式class=btn-default,控制大小class=btn-(lg | sm | xs),没有btn-md,默认即为中等大小
    • 一些简单的demo以及demo效果如下所示
    • <!DOCTYPE HTML>
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <title>无标题文档</title>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="css/bootstrap.css">
      <style>
      .glyphicon-heart {font-size: 100px; color: red;}
      </style>
      </head>
      <body> <div class="container">
      <input type="button" value="按钮" class="btn" />
      <input type="button" value="按钮" class="btn btn-default" />
      <input type="button" value="按钮" class="btn btn-link" /> <br>
      <input type="button" value="按钮" class="btn btn-primary" />
      <input type="button" value="按钮" class="btn btn-primary btn-lg" />
      <input type="button" value="按钮" class="btn btn-primary btn-sm" />
      <input type="button" value="按钮" class="btn btn-primary btn-xs" /> <br><br>
      <input type="button" value="按钮" class="btn btn-primary" />
      <input type="button" value="按钮" class="btn btn-primary active" />
      <input type="button" value="按钮" class="btn btn-primary disabled" /> <br><br>
      <a href="#" value="按钮" class="btn btn-primary">按钮</a>
      <button class="btn btn-primary">按钮</button>
      <br><br>
      <button class="btn btn-primary btn-block">按钮</button>
      </div> </body>
      <script src="js/jquery-2.1.3.js"></script>
      <script src="js/bootstrap.js"></script>
      </html>

  2. 按钮组
    • class=btn-group
    • 若希望按钮组的宽度和容器宽度一样,则可设置class=btn-group-justified,需要注意的是在按钮组中只有a标签的可以和容器宽度一样,button和input标签均不能和容器同宽度
    • 若希望按钮组垂直排列,则可设置class=btn-group-vertical
    • btn-group一般不与btn-group-vertical同时使用
    • 表示箭头上下的可以设置class=dropdown dropup
    • 控制按钮组的大小class=btn-group-(lg | sm | xs),以上的demo及demo效果如下所示
    • <!DOCTYPE HTML>
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <title>无标题文档</title>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="css/bootstrap.css">
      <style>
      .glyphicon-heart {font-size: 100px; color: red;}
      </style>
      </head>
      <body> <div class="container">
      <div class="btn-group">
      <button class="btn btn-primary">按钮1</button>
      <button class="btn btn-primary">按钮2</button>
      <button class="btn btn-primary">按钮3</button>
      </div>
      <br><br>
      <div class="btn-group btn-group-justified">
      <button href="#" class="btn btn-primary">按钮1</button>
      <button href="#" class="btn btn-primary">按钮2</button>
      <button href="#" class="btn btn-primary">按钮3</button>
      </div>
      <br><br>
      <div class="btn-group btn-group-justified">
      <a href="#" class="btn btn-primary">按钮1</a>
      <a href="#" class="btn btn-primary">按钮2</a>
      <a href="#" class="btn btn-primary">按钮3</a>
      </div>
      <br>
      <div class="btn-group-vertical">
      <button class="btn btn-primary">按钮1</button>
      <button class="btn btn-primary">按钮2</button>
      <button class="btn btn-primary">按钮3</button>
      </div>
      <div class="btn-group-vertical btn-group-lg">
      <button class="btn btn-primary">按钮1</button>
      <button class="btn btn-primary">按钮2</button>
      <button class="btn btn-primary">按钮3</button>
      </div>
      <div class="btn-group-vertical btn-group-sm">
      <button class="btn btn-primary">按钮1</button>
      <button class="btn btn-primary">按钮2</button>
      <button class="btn btn-primary">按钮3</button>
      </div>
      <div class="btn-group-vertical btn-group-xs">
      <button class="btn btn-primary">按钮1</button>
      <button class="btn btn-primary">按钮2</button>
      <button class="btn btn-primary">按钮3</button>
      </div>
      <br><br>
      <a href="#" class="btn btn-primary">按钮<span class="caret"></span></a>
      <br><br>
      <a href="#" class="btn btn-primary dropup">按钮<span class="caret"></span></a>
      <br><br>
      <div class="btn-group dropup">
      <button class="btn btn-primary">按钮</button>
      <button class="btn btn-primary"><span class="caret"></span></button>
      </div>
      </div> </body>
      <script src="js/jquery-2.1.3.js"></script>
      <script src="js/bootstrap.js"></script>
      </html>

boostrap按钮的更多相关文章

  1. 用H5+Boostrap做简单的音乐播放器

    前言:这个是综合一下我最近在学的东西做的小Demo,到实际使用还有距离,但是用来练手巩固知识点还是不错的,最近在二刷JS书和Boostrap.css的源码,做完这个Demo也算是暂告一段落,接下来是j ...

  2. vue.js+boostrap最佳实践

    一.为什么要写这篇文章 最近忙里偷闲学了一下vue.js,同时也复习了一下boostrap,发现这两种东西如果同时运用到一起,可以发挥很强大的作用,boostrap优雅的样式和丰富的组件使得页面开发变 ...

  3. H5+Boostrap的音乐播放器

    H5+Boostrap做简单的音乐播放器 前言:这个是综合一下我最近在学的东西做的小Demo,到实际使用还有距离,但是用来练手巩固知识点还是不错的,最近在二刷JS书和Boostrap.css的源码,做 ...

  4. vue.js+boostrap

    vue.js+boostrap最佳实践 一.为什么要写这篇文章 最近忙里偷闲学了一下vue.js,同时也复习了一下boostrap,发现这两种东西如果同时运用到一起,可以发挥很强大的作用,boostr ...

  5. bootstrap-table 怎么自定义搜索按钮实现点击按钮进行查询

    bootstrap-table自带搜索框感觉有点丑,我们可以把搜索功能单独拉出来放到页面的某一个位置. 首先我们看一下官方演示: 如果你感觉集成的检索框不太好看,而且我们也不想让搜索框和列表放到一块去 ...

  6. 关于boostrap的modal隐藏问题(前端框架)

    Modal(模态框) 首先,外引boostrap和Jquery的文件环境: <link rel="stylesheet" href="https://cdn.sta ...

  7. 在ASP.NET MVC中使用Boostrap实现产品的展示、查询、排序、分页

    在产品展示中,通常涉及产品的展示方式.查询.排序.分页,本篇就在ASP.NET MVC下,使用Boostrap来实现. 源码放在了GitHub: https://github.com/darrenji ...

  8. 快速搭建vue2.0+boostrap项目

    一.Vue CLI初始化Vue项目 全局安装vue cli npm install --global vue-cli 创建一个基于 webpack 模板的新项目 vue init webpack my ...

  9. Boostrap bootstrap-table插件使用教程

    bootstrap table 简介及特性 简介 Bootstrap table 是国人开发的一款基于 Bootstrap 的 jQuery 表格插件,通过简单的设置,就可以拥有强大的单选.多选.排序 ...

随机推荐

  1. win10开始菜单打不开的解决办法

    解决方法: 1.在Win10系统下按Win+R打开运行,输入services.msc回车打开服务: 2.在服务中找到User Manager服务;3.打开usermanager服务属性,将其启动类型设 ...

  2. iPhone mobile safari fixed 元素滚动慢的问题处理

    最近做一个手机阅读应用,抓取网站数据,做格式化后,适合手机浏览器以及电脑上阅读,不显示任何其他内容无关元素. Site:http://cbread.duapp.com/ 固定左侧边栏时,使用的CSS如 ...

  3. The '_imaging' module for the PIL could not be imported: DLL load failed: The specified module could not be found

    I uninstalled the PIL and installed the Pillow and the problem solved.PIL worked fine for me with th ...

  4. Js监控回车事件

    标题通俗的说,也就是绑定当用户按下回车键要执行的事件. 下面,入正题. 第一步,先编写简单的页面代码,这里我们只需要一个按钮就足够了.当然,还有按钮事件. <html> <head& ...

  5. bzoj4306: 玩具厂

    Description 在JIH考察的地图中有N个城市,被公路依次连成了一个环,JIH想在这些城市中建一个玩具厂.城市和公路都被编号为1..N,i号公路连接i-1号城市与i号城市(1号公路连接N号城市 ...

  6. 防止SQL注入攻击,数据库操作类

    如果不规避,在黑窗口里面输入内容时利用拼接语句可以对数据进行攻击 如:输入Code值 p001' union select * from Info where '1'='1 //这样可以查询到所有数据 ...

  7. PHP之路——VC库

    VC库:https://pan.baidu.com/s/1dF9LslV    密码:v7ap

  8. (未解决)问题记录ionic android 签名之后安装到手机上点击运行出现闪退,不签名运行正常

    Log日志如下: - ::): error opening trace ) - ::): FATAL EXCEPTION: main - ::): java.lang.RuntimeException ...

  9. Asteroids

    http://poj.org/problem?id=3041 #include<cstdio> #include<cstring> #include<algorithm& ...

  10. WM_CLOSE、WM_DESTROY、WM_QUIT的区别(询问,销毁窗口,退出进程,都不是一回事)

    1.发送消息SendMessage.PostMessage PostMessage将消息放入消息队列后马上返回,而SendMessage直到窗口过程处理完消息后才返回 2.三个消息的区别 WM_CLO ...