Use Responsive Design with Bootstrap Fluid Containers —- 添加Bootstrap 响应式容器(class="container-fluid"
)
<head>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
</head>
<body>
<!--响应式容器-->
<div class="container-fluid"></div>
</body>
Make Images Mobile Responsive —- 响应式图片(class="img-responsive"
)
Center Text with Bootstrap —- 文本居中 (class="text-center"
)
Create a Bootstrap Button —- 响应式按钮(class="btn"
)
Create a Block Element Bootstrap Button —- 块级按钮(class="btn btn-block"
)
Taste the Bootstrap Button Color Rainbow —- 主要按钮/深蓝色(class="btn btn-block btn-primary
“)
Call out Optional Actions with Button Info —- 信息按钮/浅蓝色(class="btn btn-block btn-info
“)
Warn your Users of a Dangerous Action —- 危险操作按钮/红色(class="btn btn-block btn-danger"
)
Use the Bootstrap Grid to Put Elements Side By Side —- 使用 Bootstrap 网格并排排列元素
<div class="row">
<div class="col-xs-4"><button class="btn btn-block btn-primary">Like</button></div>
<div class="col-xs-4"><button class="btn btn-block btn-info">Info</button></div>
<div class="col-xs-4"><button class="btn btn-block btn-danger">Delete</button></div>
</div>
Ditch Custom CSS for Bootstrap(删除自定义 CSS 样式,使用 Bootstrap 替代) —- Bootstrap 样式(淡蓝色文字/class="text-primary"
)
Use Spans for Inline Elements —- 使用 span 标签来为 block 元素内的某部分添加特定样式(暗红色文字/class=”text-danger”)
Create a Custom Heading —-
<div class="row">
<div class="col-xs-8"><h2 class="text-primary text-center">CatPhotoApp</h2></div>
<div class="col-xs-4"><a href="#"><img class="img-responsive thick-green-border" src="/images/relaxing-cat.jpg"></a></div>
</div>
Add Font Awesome Icons to our Buttons(为按钮添加矢量图标) —-
<!--引入矢量图标库-->
<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.2.0/css/font-awesome.min.css"/>
<!--竖起大拇指图标-->
<i class="fa fa-thumbs-up"></i>
<!-- info 图标-->
<i class="fa fa-info-circle"></i>
<!-- 垃圾桶 图标-->
<i class="fa fa-trash"></i>
Add Font Awesome Icons to all of our Buttons —- 为所有按钮添加矢量图标
Responsively Style Radio Buttons —-单选按钮变成响应式
<div class="row">
<div class="col-xs-6"><label><input type="radio" name="indoor-outdoor"> Indoor</label></div>
<div class="col-xs-6"><label><input type="radio" name="indoor-outdoor"> Outdoor</label></div>
</div>
Responsively Style Checkboxes —- 多选按钮变成响应式
<div class="row">
<div class="col-xs-4"><label><input type="checkbox" name="personality"> Loving</label></div>
<div class="col-xs-4"><label><input type="checkbox" name="personality"> Lazy</label></div>
<div class="col-xs-4"><label><input type="checkbox" name="personality"> Crazy</label></div>
</div>
Style Text Inputs as Form Controls —- 样式
<!--class="form-control" 使得文本输入框占整行-->
<input type="text" class="form-control" placeholder="cat photo URL" required>
<!--<i class="fa fa-paper-plane"></i>-->
<button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i>Submit</button>
Line up Form Elements Responsively with Bootstrap
<div class="row">
<div class="col-xs-7"><input type="text" class="form-control" placeholder="cat photo URL" required></div>
<div class="col-xs-5"><button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button></div>
</div>
Create a Bootstrap Headline —- 创建一个 Bootstrap 头
<h3 class="text-primary text-center">jQuery Playground</h3>
House our page within a Bootstrap Container Fluid Div —- 将整个页面放置在一个响应式容器中
<div class="container-fluid"></div>
Create a Bootstrap Row —- 创建一个响应式列
Split your Bootstrap Row —-
Create Bootstrap Wells —- 样式(classs=”well”)
Add Elements within your Bootstrap Wells —- 在 Bootstrap well 中添加元素
Apply the Default Bootstrap Button Style(给 button 添加 Bootstrap 默认样式) —- 样式(Bootstrap 默认按钮样式/class=”btn btn-default”)
Create a Class to Target with jQuery Selectors —- 样式(class=”target”)
Add ID Attributes to Bootstrap Elements —- 给 Bootstrap 元素添加 ID 属性
Label Bootstrap Wells(标注 Bootstrap well) —-
Give Each Element a Unique ID —-
Label Bootstrap Buttons —-
Use Comments to Clarify Code —- 添加注释说明代码
<!-- Only change code above this line-->