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文本样式做一下汇总. ...
随机推荐
- 【cocos2d-js官方文档】二十、moduleConfig.json
概述 该配置文件相当于v2版本号中的jsloader.js. 改造的目的是为了使得配置纯粹化,同一时候也能比較好的支持cocos-console.cocos-utils甚至是用户自己定义脚本工具. 字 ...
- 读取excel模板填充数据 并合并相同文本单元格
try { string OutFileName = "北京市国控企业污染源废气在线比对监测数据审核表" + DateTime.Now.ToString(& ...
- 错误:com.android.builder.packaging.DuplicateFileException: Duplicate files copied
File2: C:\Users\guoxw\.gradle\caches\modules-2\files-2.1\org.jsoup\jsoup\1.10.3\b842f960942503cf1abb ...
- 五分钟DBA:浅谈伪分布式数据库架构
[IT168 技术]12月25日消息,2010互联网行业技术研讨峰会今日在上海华东理工大学召开.本次峰会以“互联网行业应用最佳实践”为主题,定位于互联网架构设计.应用开发.应用运维管理,同时,峰会邀请 ...
- firefox工具
1.XPath 查看元素的xpath https://addons.mozilla.org/zh-CN/firefox/addon/xpath-checker/ 2. Tamper Data 查看页面 ...
- innerHTML 与 outerHTML区别
示例代码: <div id="test"> <p>这是innerHTML</p> <p>这是innerHTML</p> ...
- Oracle的分页查询及内联视图和函数处理
1.Oracle的分页常用方式: select * from(select * ,ROWNUM num from table where ROWNUM<=20 ) where num>0; ...
- 粘包解决高端_Server
from socket import * #导入套接字模块的所有命令import subprocess #导入subprocess模块,用于执行命令行import struct #导入struck模块 ...
- Unity5.X 创建基本的3D游戏场景
点New(新建懒得写了,反正不是智障应该都会) 创建好的项目会自带一个场景,场景会自带Main Camera (主摄像机),Directional Light (方向光) 系统自带几个可以创建的3 ...
- 算法21----重塑矩阵 LeetCode566
1.题目 在MATLAB中,有一个非常有用的函数 reshape,它可以将一个矩阵重塑为另一个大小不同的新矩阵,但保留其原始数据. 给出一个由二维数组表示的矩阵,以及两个正整数r和c,分别表示想要的重 ...