<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>study</title> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <!-- 栅格系统 1、定义容器 container:固定宽度 container-fluid:宽度100% 2、定义行 row 3、定义栅格:col-栅格参数-栅格占位数 xs:手机(<768px) sm:平板(>=768px) md:中等屏幕(>=992px) lg:大屏幕(>=1200px) * 一行共12个栅格占位数,超过则换行 * 小的栅格参数兼容大的屏幕 * 大的栅格参数使用在小的屏幕,则每个栅格占一行 --> <div class="container"> <div class="row"> <div class="col-xs-6" style="border: 1px solid">.col-xs-6</div> <div class="col-xs-6" style="border: 1px solid">.col-xs-6</div> </div> </div> <hr/> <div class="container"> <div class="row"> <div class="col-sm-6" style="border: 1px solid">.col-sm-6</div> <div class="col-sm-6" style="border: 1px solid">.col-sm-6</div> </div> </div> <hr/> <div class="container"> <div class="row"> <div class="col-md-6" style="border: 1px solid">.col-md-6</div> <div class="col-md-6" style="border: 1px solid">.col-md-6</div> </div> </div> <hr/> <div class="container"> <div class="row"> <div class="col-lg-6" style="border: 1px solid">.col-lg-6</div> <div class="col-lg-6" style="border: 1px solid">.col-lg-6</div> </div> </div> <hr/> <div class="container-fluid"> <div class="row"> <div class="col-xs-6" style="border: 1px solid">.col-xs-6</div> <div class="col-xs-6" style="border: 1px solid">.col-xs-6</div> <div class="col-xs-1" style="border: 1px solid">.col-xs-1</div> </div> <div class="row"> <div class="col-xs-6" style="border: 1px solid">.col-xs-6</div> <div class="col-xs-6" style="border: 1px solid">.col-xs-6</div> </div> </div> </body> </html>