常用的控件

1.h1-h6

h1~h3的margin为20px;h4-h6的margin为10px

定义了6个类名。h1 h2 h3 h4 h5 h6

大小:h1为36px,依次减6

h1 small,

.h1 small,

h2 small,

.h2 small,

h3 small,

.h3 small,

h1 .small,

.h1 .small,

h2 .small,

.h2 .small,

h3 .small,

.h3 .small {

font-size: 65%;

}

h4,

.h4,

h5,

.h5,

h6,

.h6 {

margin-top: 10px;

margin-bottom: 10px;

}

h4 small,

.h4 small,

h5 small,

.h5 small,

h6 small,

.h6 small,

h4 .small,

.h4 .small,

h5 .small,

.h5 .small,

h6 .small,

.h6 .small {

font-size: 75%;

}

2.p

p {

margin: 0 0 10px;

}

3.body

body {

font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;

font-size: 14px;

line-height: 1.42857143;

color: #333;

background-color: #fff;

}

4.强调文本

添加class="lead";  <small>/<em>/<strong>/<cite>

.lead {

margin-bottom: 20px;

font-size: 16px;

font-weight: 200;

line-height: 1.4;

}

@media (min-width: 768px) {/*大中型浏览器字体稍大*/

.lead {

font-size: 21px;

}}


5.粗体

<b>/<strong>

6.斜体

<i>

7.强调的相关类

 

8.文本对齐

9.列表

10.列表的一些属性

.list-unstyled,

水平列表 .list-inline

水平定义列表  .dl-horizontal

11.表格

基础表格: .table

斑马表格:.table   .table-striped

带边框的表格:.table   .table-bordered

鼠标悬停高亮的表格:.table   .table-hover

紧凑型的表格: .table   .table-condensed

响应式表格: .table   .table-responsive 

12.表格的一些属性

表格行的类

13.表单

基础表单

role="form"

水平表单

.form-horizontal

内联表单 

.form-inline

阻止label换行:

.form-group/.sr-only

表单中保证样式不出错

.form-control

输入框

input+type+.form-control+placeholder

下拉选择框

<form role="form">

<div class="form-group">

<select class="form-control">

<option></options>

</select>

<div class="form-group">

<select multiple class="form-control">

<option>1</option>

</select>

</div>

</form>


文本域

<textarea class="form-control" rows="3">

</textarea>


复选框checkbox和单选择按钮radio

.checkbox+.radio

水平:在lable标签添加 class="checkbox-inline "/"radio-inline"





表单控件(按钮)

input[type="submit"]

input[type="button"]

input[type="reset"]


表单控件的大小

.control-label/

大:form-control input-lg

正常:form-control

小:form-control input-sm


表单控制状态(焦点状态)

.form-control


表单控制状态(禁用状态)

只要要标签上添加disabled


表单的控件的状态(验证状态)

.has-warning:警告状态(黄色)

.has-error:错误状态(红色)

.has-success:成功状态(绿色)

将以上3个添加上has-feedback这个类就能显示出对应的图标


表单提示的信息
.help-block



14.按钮

<span>/<input>/<div>都可以使用

按钮大小
添加:btn-lg/btn-sm/btn-xs/


15.图片

img-responsive:相应图片

.img-rounded:圆角图片

.img-circle:圆形图片

.img-thumbnail:缩略图片


16.图标

http://getbootstrap.com/components/#glyphicons

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 13,800评论 1 92
  • Bootstrap是什么? 一套易用、优雅、灵活、可扩展的前端工具集--BootStrap。GitHub上介绍 的...
    凛0_0阅读 10,925评论 3 184
  • #iOS开发之UI篇#iOS开发之UI篇 #常用控件介绍1## #UI第09天:滚动视图# ##UIScrollV...
    LennonLin阅读 1,797评论 0 0
  • 如果说这两天在朋友圈最火的电影是什么,那无疑是大鱼海棠了。这部顶着12年情怀光环的国产动画电影近期可谓是话题感爆棚...
    Moore_M阅读 1,823评论 19 20
  • 小五一到这种天气就喜欢缩在家里暖气片旁边,貌似猫咪都是很怕冷的。不仅仅小五,W先生也是很怕冷的,毕竟他家在温暖的南...
    Caphintty图图阅读 140评论 1 1