Bootstrap全局CSS样式之表单
.form-control——将单独的表单控件赋予一些全局样式,如默认宽度width:100%。
.form-group——包裹表单控件,获得最好的排列;
.form-inline——将表单设置为内联表单,仅仅适用于视口(viewport)至少在 768px 宽度时;
.sr-only——将label标签隐藏;
.help-block——用于设置提示文本;
.form-horizontal——能够将label标签和控件组水平并排布局;
.radio-inline、.checkbox-inline——将对应控件水平排列。
.form-control-static——将p元素设置为静态控件。
.has-error、.has-warning、has-success——分别相应校验状态。
.has-feedback——为控件加入辅助图标(与图标引用类联合使用);
.input-lg——创建大一些的表单控件。
.input-sm——创建小一些的表单控件;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>CSS全局样式_栅格系统</title>
<!--
<link rel="stylesheet" href="bootstrap.min.css" type="text/css">
-->
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<style type="text/css"> </style>
</head>
<body>
<div class="container">
<form role="form" class="form-inline">
<div class="form-group">
<label class="sr-only">username</label>
<input type="text" class="form-control" placeholder="username/邮箱/手机号"/>
</div>
<div class="form-group">
<label class="sr-only">password</label>
<input type="password" class="form-control" placeholder="输入6-14位英文和数字组合password"/>
</div>
<div class="form-group">
<label class="sr-only">生日</label>
<input type="date" class="form-control" placeholder="出生年月"/>
</div>
<div class="form-group">
<label class="sr-only">上传头像</label>
<input type="file" class="form-control input-lg"/>
<p class="help-block">选择您须要的头像文件</p>
</div>
</form>
<form role="form" class="form-horizontal">
<div class="form-group">
<label class="col-sm-4 control-label">username</label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="username/邮箱/手机号"/>
</div> </div>
<div class="form-group">
<label class="col-sm-4 control-label">password</label>
<div class="col-sm-8">
<input type="password" class="form-control" placeholder="输入6-14位英文和数字组合password"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">生日</label>
<div class="col-sm-8">
<input type="date" class="form-control" placeholder="出生年月"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox"/>记住password
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<button class="btn btn-default">登录</button>
</div>
</div>
</form>
<form role="form" class="form-horizontal">
<div class="form-group">
<label>喜欢的球队</label>
<div class="checkbox">
<label>
<input type="checkbox"/>广州恒大
</label>
<label>
<input type="checkbox"/>上海上港
</label>
<label>
<input type="checkbox"/>北京国安
</label>
</div>
</div>
<div class="form-group">
<label>性别</label>
<div class="radio">
<label>
<input type="radio" checked name="gender"/>男
</label>
<label>
<input type="radio" name="gender"/>女
</label>
</div>
</div>
<div class="form-group">
<label>所属城市</label>
<select class="form-control" multiple>
<option>北京</option>
<option>上海</option>
<option>广州</option>
</select>
</div>
<div class="form-group">
<label class="sr-only"></label>
<textarea class="form-control" rows="5" placeholder="请文明用语"></textarea>
</div>
<p class="form-control-static">请依照邮箱格式输入:hello@163.com</p>
<div class="form-group">
<label>password</label>
<input class="form-control" type="password" disabled/>
</div>
<div class="form-group">
<label>昵称</label>
<input class="form-control" type="text" placeholder="胖虎" readonly/>
</div>
<div class="form-group has-error has-feedback">
<label>username</label>
<input class="form-control" type="text" />
<span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div>
<div class="form-group has-success has-feedback">
<label>username</label>
<input class="form-control" type="text" />
<span class="glyphicon glyphicon-ok form-control-feedback"></span>
</div>
<div class="form-group has-warning has-feedback">
<label>username</label>
<input class="form-control" type="text" />
<span class="glyphicon glyphicon-warning-sign form-control-feedback"></span>
</div>
</form>
</div> </body>
</html>
Bootstrap全局CSS样式之表单的更多相关文章
- bootstrap全局CSS样式学习
参考http://v3.bootcss.com/css/,根据自己的记忆进行的复述,加深记忆. 首先介绍bootstrap全局CSS样式 只通过使用bootstrap.css,即可获得统一的样式设置. ...
- 响应式布局和BootStrap 全局CSS样式
1.什么是响应式布局 响应式布局是Ethan Marcotte在2010年5月份提出的一个概念,这个概念是为解决移动互联网浏览而诞生的. 简而言之,就是一个网站能够兼容多个终端——而不是为每个终端做一 ...
- 14、响应式布局和BootStrap 全局CSS样式知识点总结-part1
1.什么是响应式布局 响应式布局是Ethan Marcotte在2010年5月份提出的一个概念,这个概念是为解决移动互联网浏览而诞生的. 简而言之,就是一个网站能够兼容多个终端——而不是为每个终端做一 ...
- bootstrap 全局 CSS 样式
http://v3.bootcss.com/css/#less-mixins-utility 深入了解 Bootstrap 底层结构的关键部分,包括我们让 web 开发变得更好.更快.更强壮的最佳实践 ...
- Bootstrap--全局css样式之表单
单独的表单控件会被自动赋予一些全局样式.所有设置了 .form-control 类的 <input>.<textarea> 和 <select> 元素都将被默认设置 ...
- bootstrap全局css样式
以下从官网抄来的,感觉还是很实用的,运用得好,灵活运用,非常方便快捷,能大大提高开发效率,也为调整不同尺寸的屏幕节省了时间. hidden-xs @media (max-width: 767px){ ...
- 15、响应式布局和BootStrap 全局CSS样式知识点总结-part2
1.表格 <div class="container"> <table class="table "> <thead> &l ...
- Bootstrap - 全局css样式类
状态类 通过这些状态类可以为行或单元格设置颜色. .active 鼠标悬停在行或单元格上时所设置的颜色 .success 标识成功或积极的动作 .info 标识普通的提示信息或动作 .warning ...
- Bootstrap全局CSS样式之排版
Bootstrap能全然友好的支持html5的文本元素,这里不再赘述,详细可參考我还有一篇文章<html的文本元素总结>,这里主要针对Bootstrap封装好的CSS文本样式做一下汇总. ...
随机推荐
- Struts2值栈的相关操作
import org.apache.struts2.ServletActionContext; import com.opensymphony.xwork2.ActionContext; import ...
- js最简单的-点击小图放大
js最简单的-点击小图放大 标签(空格分隔): js <html> <body> <img class="imgview" src="{$v ...
- batch normalization学习理解笔记
batch normalization学习理解笔记 最近在Andrew Ng课程中学到了Batch Normalization相关内容,通过查阅资料和原始paper,基本上弄懂了一些算法的细节部分,现 ...
- lightshot截图工具的安装及使用
通常我们做PPT或者写博客难免要用到截图工具,而Windows自带的snippingtool启动有延迟也不够方便,QQ有截屏又需要联网及登录情况下,于是我想着在Chrome上搜一款清新简洁的截屏软件, ...
- 循环引用的weak和assgin
__weak 当对象销毁后weakSelf指向的地址为nil __unsafe_unretained 挡圈对象销毁后,weakSelf执行的地址为不变,而地址对应对象已经销毁,再次访问该对象就崩溃,相 ...
- MyEclipse 安装svn 插件步骤详情
方法一:在线安装 打开HELP- > MyEclipse Configuration Center.切换到SoftWare标签页. 点击Add Site 打开对话框,在对话框Name输入Svn, ...
- 关于HTML与CSS与class
在web前端开发中接触的一直是html.css.javascript. 在这个过程中,经常使用的是html中的span.div元素以及css的选择器. 为了方便查找在这里将这些内容的基础知识记录下来. ...
- Dragon Balls[HDU3635]
Dragon Balls Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- Linux学习日记——字符处理
(菜鸡学习日记 各种使用命令只列举了常用几种,发现错误望指正) 一.管道 在Linux 中,管道就是一个固定大小的缓冲区,大小为一页4K.它是一种通信的机制,可以使用管道符“ | ” 来连接进程,连接 ...
- Ubuntu 16.04 Go环境搭建 Go环境+Sublime配置
Ubuntu 16.04 Go环境搭建 Go环境+Sublime配置 1. 安装Go 下载地址https://golang.org/dl/ (需要翻下) 下载到类似go1.8.3.linux-amd6 ...