Bootstrap 表单
2016-03-15 21:39
561 查看
1.输入框组 form-group 多选框checkbox
2.默认样式.form-control
<input
type="email"
class="form-control"
id="exampleInputEmail1"
placeholder="Enter
email">
3.文本
help-block
< p class= "help-block">***</p>
4.内联表单 ( 在一行)form-inline
<form
class="form-inline"></form>
5.
隐藏 sr-only
<label
class="sr-only">Email
address</label>
4000
6.水平排列的表单
form-horizontal
通过为表单添加
7.向右对齐
control-label 比text-right样式更加合理 (还加了行高)
<label
for="inputPassword3"
class="col-sm-2 control-label">Password</label>
8.文本框(宽度固定
可根据需要调节row的数据)
<textarea
class="form-control"
rows="3"></textarea>
9.单选框
(和复选框一致)
<div
class="radio">
<label>
<input
type="radio"
name="optionsRadios"
id="optionsRadios1"
value="option1"
checked>
Option
one is this and that—be sure to include why it's great
</label>
</div>
<div
class="radio">
<label>
<input
type="radio"
name="optionsRadios"
id="optionsRadios2"
value="option2">
Option
two can be something else and selecting it will deselect option one
</label>
</div>
10.单选
复选 行排列
<label
class="checkbox-inline">
<input
type="checkbox"
id="inlineCheckbox1"
value="option1">
1
</label>
<label
class="checkbox-inline">
<input
type="checkbox"
id="inlineCheckbox2"
value="option2">
2
</label>
<label
class="checkbox-inline">
<input
type="checkbox"
id="inlineCheckbox3"
value="option3">
3
</label>
11.输入框样式:has-success
has-warning
has-error
<div
class="form-group has-success">
<label
class="control-label"
for="inputSuccess">Input
with success</label>
<input
type="text"
class="form-control"
id="inputSuccess">
</div>
<div
class="form-group has-warning">
<label
class="control-label"
for="inputWarning">Input
with warning</label>
<input
type="text"
class="form-control"
id="inputWarning">
</div>
<div
class="form-group has-error">
<label
class="control-label"
for="inputError">Input
with error</label>
<input
type="text"
class="form-control"
id="inputError">
</div>
12.控件大小
*-lg大
* 默认中等 *-sm 小
<div class="form-group"> <label for="exampleInputEmail1">Email address</label> <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email"> </div>
<div class="checkbox">
<label> <input type="checkbox"> Remember me </label>
</div>
2.默认样式.form-control
<input
type="email"
class="form-control"
id="exampleInputEmail1"
placeholder="Enter
email">
3.文本
help-block
< p class= "help-block">***</p>
4.内联表单 ( 在一行)form-inline
<form
class="form-inline"></form>
5.
隐藏 sr-only
<label
class="sr-only">Email
address</label>
4000
6.水平排列的表单
form-horizontal
通过为表单添加
.form-horizontal,并使用Bootstrap预置的栅格class可以将label和控件组水平并排布局。这样做将改变
.form-group的行为,使其表现为栅格系统中的行(row),因此就无需再使用
.row了。
7.向右对齐
control-label 比text-right样式更加合理 (还加了行高)
<label
for="inputPassword3"
class="col-sm-2 control-label">Password</label>
8.文本框(宽度固定
可根据需要调节row的数据)
<textarea
class="form-control"
rows="3"></textarea>
9.单选框
(和复选框一致)
<div
class="radio">
<label>
<input
type="radio"
name="optionsRadios"
id="optionsRadios1"
value="option1"
checked>
Option
one is this and that—be sure to include why it's great
</label>
</div>
<div
class="radio">
<label>
<input
type="radio"
name="optionsRadios"
id="optionsRadios2"
value="option2">
Option
two can be something else and selecting it will deselect option one
</label>
</div>
10.单选
复选 行排列
<label
class="checkbox-inline">
<input
type="checkbox"
id="inlineCheckbox1"
value="option1">
1
</label>
<label
class="checkbox-inline">
<input
type="checkbox"
id="inlineCheckbox2"
value="option2">
2
</label>
<label
class="checkbox-inline">
<input
type="checkbox"
id="inlineCheckbox3"
value="option3">
3
</label>
11.输入框样式:has-success
has-warning
has-error
<div
class="form-group has-success">
<label
class="control-label"
for="inputSuccess">Input
with success</label>
<input
type="text"
class="form-control"
id="inputSuccess">
</div>
<div
class="form-group has-warning">
<label
class="control-label"
for="inputWarning">Input
with warning</label>
<input
type="text"
class="form-control"
id="inputWarning">
</div>
<div
class="form-group has-error">
<label
class="control-label"
for="inputError">Input
with error</label>
<input
type="text"
class="form-control"
id="inputError">
</div>
12.控件大小
*-lg大
* 默认中等 *-sm 小
相关文章推荐
- Bootstrap 下拉菜单
- Bootstrap 小图标
- Bootstrap 2.3版与3.0版的使用区别
- bootstrap_下拉菜单+头部
- Bootstrap开发总结
- Bootstrap 引入 栅栏系统 文本 表格 类
- bootstrap的tree控件
- springmvc4 mybatis 整合 框架源码 bootstrap SSM
- Bootstrap学习笔记
- 时间控件在bootstrap模态框中的使用
- bootStrap的模态框在IE的失效
- Bootstrap 辅助样式
- Bootstrap 表单
- Bootstrap 表格
- flask-bootstrap 模板 +用户界面+自定义错误页面
- 初涉bootstrap:bootstrap 插件
- 初涉bootstrap:bootstrap css
- java bootstrap分页
- bootstrap-datetimepicker日期时间选择器使用文档
- 基于bootstrap的网页开发