Bootstrap_表单_表单控件状态
一、焦点状态
焦点状态是通过伪类“:focus”来实现。Bootstrap框架中表单控件的焦点状态删除了outline的默认样式,重新添加阴影效果。
<form role="form" class="form-horizontal">
<div class="form-group">
<div class="col-xs-6">
<input class="form-control input-lg" type="text" placeholder="不是焦点状态下效果">
</div>
<div class="col-xs-6">
<input class="form-control input-lg" type="text" placeholder="焦点点状态下效果">
</div>
</div>
</form>

二、禁用状态
Bootstrap框架的表单控件的禁用状态和普通的表单禁用状态实现方法是一样的,在相应的表单控件上添加属性“disabled”。
<form role="form">
<input class="form-control input-lg" id="disabledInput" type="text" placeholder="表单已被禁用,不可输入" disabled>
<fieldset disabled>
<div class="form-group">
<label for="disabledTextInput">禁用的输入框</label>
<input type="text" id="disabledTextInput" class="form-control" placeholder="禁止输入">
</div>
<div class="form-group">
<label for="disabledSelect">禁用的下拉框</label>
<select id="disabledSelect" class="form-control">
<option>不可选择</option>
</select>
</div>
<div class="checkbox">
<label>
<input type="checkbox"> 无法选择
</label>
</div>
<button type="submit" class="btn btn-primary">提交</button>
</fieldset>
</form>

三、验证状态
在制作表单时,不免要做表单验证。同样也需要提供验证状态样式,在Bootstrap框架中同样提供这几种效果。
1、.has-warning:警告状态(黄色)
2、.has-error:错误状态(红色)
3、.has-success:成功状态(绿色)
使用的时候只需要在form-group容器上对应添加状态类名
<form role="form">
<div class="form-group has-success">
<label class="control-label" for="inputSuccess1">成功状态</label>
<input type="text" class="form-control" id="inputSuccess1" placeholder="成功状态" >
</div>
<div class="form-group has-warning">
<label class="control-label" for="inputWarning1">警告状态</label>
<input type="text" class="form-control" id="inputWarning1" placeholder="警告状态">
</div>
<div class="form-group has-error">
<label class="control-label" for="inputError1">错误状态</label>
<input type="text" class="form-control" id="inputError1" placeholder="错误状态">
</div>
</form>

Bootstrap_表单_表单控件状态的更多相关文章
- Bootstrap_表单_表单提示信息
平常在制作表单验证时,要提供不同的提示信息.在Bootstrap框架中也提供了这样的效果.使用了一个"help-block"样式,将提示信息以块状显示,并且显示在控件底部. < ...
- Bootstrap_表单_表单控件
一.输入框input 单行输入框,常见的文本输入框,也就是input的type属性值为text. 在Bootstrap中使用input时也必须添加type类型,如果没有指定type类型,将无法得到正确 ...
- Bootstrap_表单_表单样式
一.基础表单 <form > <div class="form-group"> <label>邮箱:</label> <inp ...
- SpringBoot(五)_表单验证
SpringBoot(五)_表单验证 参数校验在我们日常开发中非常常见,最基本的校验有判断属性是否为空.长度是否符合要求等,在传统的开发模式中需要写一堆的 if else 来处理这些逻辑,很繁琐,效率 ...
- Day055--MySQL--外键的变种,表与表的关系,单表查询,多表查询, 内连接,左右连接,全外连接
表和表的关系 ---- 外键的变种 * 一对多或多对一 多对多 一对一 参考 https://www.cnblogs.com/majj/p/9169416.html 如何找出两张表之间的关系 分析步骤 ...
- python mysql 单表查询 多表查询
一.外键 变种: 三种关系: 多对一 站在左表的角度: (1)一个员工 能不能在 多个部门? 不成立 (2)多个员工 能不能在 一个部门? 成立 只要有一个条件成立:多 对 一或者是1对多 如果两个条 ...
- python 全栈开发,Day62(外键的变种(三种关系),数据的增删改,单表查询,多表查询)
一.外键的变种(三种关系) 本节重点: 如何找出两张表之间的关系 表的三种关系 一.介绍 因为有foreign key的约束,使得两张表形成了三种了关系: 多对一 多对多 一对一 二.重点理解如果找出 ...
- mysq更新(六) 单表查询 多表查询
本节重点: 单表查询 语法: 一.单表查询的语法 SELECT 字段1,字段2... FROM 表名 WHERE 条件 GROUP BY field HAVING 筛选 ORDER BY fiel ...
- MYSQL数据类型 表基本操作 表记录增删改 单表查询
一.数据类型 常用的数据类型如下: 整数:int,bit 小数:decimal 字符串:varchar,char 日期时间: date, time, datetime 枚举类型(enum) 特别说明的 ...
随机推荐
- 使用Jquery解析Json基础知识(转)
在WEB数据传输过程中,json是以文本,即字符串的轻量级形式传递的,而客户端一般用JS操作的是接收到的JSON对象,所以,JSON对象和JSON字符串之间的相互转换.JSON数据的解析是关键. 先明 ...
- openStack opts
- Coprimes - SGU 102(求互质数,水)
题目大意:给你一个正整数N,求出来不超过N 的并且与N互质的正整数的个数. 就是一个大水题~~~ 代码: #include<stdio.h> #include<string.h> ...
- tomcat在linux中的启动和查看相关信息
打开终端cd /java/tomcat#执行bin/startup.sh #启动tomcatbin/shutdown.sh #停止tomcattail -f logs/catalina.out # ...
- Call-time pass-by-reference has been deprecated
Warning: Call-time pass-by-reference has been deprecated解决方法 第一种方法: 修改php.ini就可以了. 1. 在PHP.ini中搜索关键字 ...
- config 数据库字符串的读取、修改 分类: WebForm 2014-12-16 10:24 203人阅读 评论(0) 收藏
config数据库字符串: <connectionStrings> <add name="MyWebDataString" connectionString= ...
- OpenCV与QT联合编译 分类: Eye_Detection ZedBoard OpenCV shell ubuntu 2014-11-08 18:54 143人阅读 评论(0) 收藏
问题1:首先参考rainysky的博客,发现qmake时发生找不到目录,文件的错误,又找不到 qmake.conf 文件的写法.所以开始按照网上的程序修改 XXX.pro 文件. 问题2:使用QT C ...
- Readprocessmemory使用方法
函数功能:该函数从指定的进程中读入内存信息,被读取的区域必须具有訪问权限. 函数原型:BOOL ReadProcessMemory(HANDLE hProcess,LPCVOID lpBaseAddr ...
- syslog实例详解rsyslog
http://blog.csdn.net/chenhao112358/article/details/40892239http://www.cnblogs.com/blueswu/p/3564763. ...
- UITableView beginUpdate和endUpdate使用的前提
转载地址:http://blog.csdn.net/vieri_ch/article/details/46893023 UITableView有两个方法,用于单元格动画变化的方法,beginUpdat ...