container :两边留白
container-fluid :每一种设备都是100%宽度
注意∶
1.一行中如果格子数目超过12,则超出部分自动换行。
2,栅格类属性可以向上兼容。栅格类适用于与屏幕宽度大于或等于分界点大小的设备。
3.如果真实设备宽度小于了设置栅格类属性的设备代码的最小值,会一个元秦沾满一整行。
<div class="container"> <div class="row"> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <!-- <div class="col-lg-1 col-sm-2 inner">栅格</div>--> <div class="col-md-13 inner">栅格</div> <div class="col-md-1 inner">栅格</div> </div> </div>
Bootstarp_全局CSS样式_按钮&图片
按钮: class="btn btn-default"、
图片:
class="img-responsive”:图片在任意尺寸都占100%
图片形状
<img src="../img/banner_1.jpg" class="img-responsive">
<img src="../img/banner_1.jpg" class="img-responsive img-rounded">
<img src="../img/banner_1.jpg" class="img-responsive img-thumbnail">
<img src="../img/banner_1.jpg" class="img-responsive img-circle">
<!doctype html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <title>Bootstrap HelloBootstrap</title> <!-- Bootstrap --> <link rel="stylesheet" href="css/bootstrap.min.css"> <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) --> <script src="js/jquery-3.2.1.min.js"></script> <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 --> <script src="js/bootstrap.min.js"></script> <style> .inner{ border: 1px solid rebeccapurple; } </style> </head> <body> <a class="btn btn-default" href="#" >Link</a> <button class="btn btn-default" type="submit">Button</button> <input class="btn btn-default" type="button" value="Input"> <input class="btn btn-default" type="submit" value="Submit"> <br> <!-- Provides extra visual weight and identifies the primary action in a set of buttons --> <button type="button" class="btn btn-primary">(首选项)Primary</button> <!-- Indicates a successful or positive action --> <button type="button" class="btn btn-success">(成功)Success</button> <!-- Contextual button for informational alert messages --> <button type="button" class="btn btn-info">(一般信息)Info</button> <!-- Indicates caution should be taken with this action --> <button type="button" class="btn btn-warning">(警告)Warning</button> <!-- Indicates a dangerous or potentially negative action --> <button type="button" class="btn btn-danger">(危险)Danger</button> <!-- Deemphasize a button by making it look like a link while maintaining button behavior --> <button type="button" class="btn btn-link">(链接)Link</button> <hr> <img src="../img/banner_1.jpg" class="img-responsive"> <img src="../img/banner_1.jpg" class="img-responsive img-rounded"> <img src="../img/banner_1.jpg" class="img-responsive img-thumbnail"> <img src="../img/banner_1.jpg" class="img-responsive img-circle"> </body> </html>