Bootstrap3 表单-添加额外的图标
来源:互联网 发布:it服装 编辑:程序博客网 时间:2024/06/14 04:45
你还可以针对校验状态为输入框添加额外的图标。只需设置相应的 .has-feedback 类并添加正确的图标即可。
反馈图标只处理文本 <input class="form-control">元素。
图标、label 和输入控件组
对于不带有 label 标签的输入框以及右侧带有附加组件的输入框组,需要手动为其图标定位。为了让所有用户都能访问你的网站,我们强烈建议为所有输入框添加 label 标签。如果你不希望将 label 标签展示出来,可以通过添加 sr-only 类来实现。如果的确不能添加 label 标签,请调整图标的 top 值。对于输入框组,请根据你的实际情况调整 right 值。
<div class="form-group has-success has-feedback"> <label class="control-label" for="inputSuccess2">Input with success</label> <input type="text" class="form-control" id="inputSuccess2"> <span class="glyphicon glyphicon-ok form-control-feedback"></span></div><div class="form-group has-warning has-feedback"> <label class="control-label" for="inputWarning2">Input with warning</label> <input type="text" class="form-control" id="inputWarning2"> <span class="glyphicon glyphicon-warning-sign form-control-feedback"></span></div><div class="form-group has-error has-feedback"> <label class="control-label" for="inputError2">Input with error</label> <input type="text" class="form-control" id="inputError2"> <span class="glyphicon glyphicon-remove form-control-feedback"></span></div>
为水平排列的表单和内联表单设置可选的图标
<form class="form-horizontal" role="form"> <div class="form-group has-success has-feedback"> <label class="control-label col-sm-3" for="inputSuccess3">Input with success</label> <div class="col-sm-9"> <input type="text" class="form-control" id="inputSuccess3"> <span class="glyphicon glyphicon-ok form-control-feedback"></span> </div> </div></form>
<form class="form-inline" role="form"> <div class="form-group has-success has-feedback"> <label class="control-label" for="inputSuccess4">Input with success</label> <input type="text" class="form-control" id="inputSuccess4"> <span class="glyphicon glyphicon-ok form-control-feedback"></span> </div></form>
可选的图标与设置 .sr-only 类的 label
通过为 label 元素添加 .sr-only 类,可以让表单控件的 label 元素不可见。在这种情况下,Bootstrap 将自动调整图标的位置。
<div class="form-group has-success has-feedback"> <label class="control-label sr-only" for="inputSuccess5">Hidden label</label> <input type="text" class="form-control" id="inputSuccess5"> <span class="glyphicon glyphicon-ok form-control-feedback"></span></div>
—–下面有个“顶”字,你懂得O(∩_∩)O哈哈~
—–乐于分享,共同进步!
—–更多文章请看:http://blog.csdn.net/duruiqi_fx
1 0
- Bootstrap3 表单-添加额外的图标
- Bootstrap3 表单-水平排列的表单
- keyBoard添加额外的按钮
- 17.5 添加额外的文件
- Bootstrap3 表单-被禁用的 fieldset
- Bootstrap3 表单-基本表单
- Bootstrap3 表单-水平排列的表单组的尺寸
- 为对象添加额外的属性
- Jetty中添加额外的jar包
- eclipse中添加额外的jar包
- IntelliJ IDEA添加额外的jar包
- ie8下bootstrap3的Glyphicons图标不显示问题
- bootstrap3-validation表单验证
- bootstrap3-validation表单验证
- Bootstrap3 表单-校验状态
- Bootstrap3 表单-辅助文本
- Bootstrap3 表单-输出内联表单
- bootstrap3-validation.js bootstrap 的jquery 表单验证
- 关于HADOOP_CLASSPATH
- 精通 CSS+DIV 网页样式与布局 147
- ios CGAffineTransformScale缩放 中心点问题
- 张量
- 聚类算法:k均值(k-means)
- Bootstrap3 表单-添加额外的图标
- 精通 CSS+DIV 网页样式与布局 148
- 读代码,写结果
- 精通 CSS+DIV 网页样式与布局 149
- MongoDB中强大的统计框架Aggregation使用实例解析
- Map的基本操作
- node.js express框架后台搭建
- linux 安装subversion-1.9.4
- 跟我一起学C# 设计模式