栅格系统bootstrap

<!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">
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <style>
      .container{
        border: 1px solid #ccc;
      }
    </style>
  </head>
  <body>
<!-- 从堆叠到水平排列 -->
  <div class="container">
    <div class="row">
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
      <div class="col-xs-1">col-xs-1</div>
    </div>
  </div>
  <div class="container">
      <div class="row">
        <div class="col-xs-8">col-xs-8</div>
        <div class="col-xs-4">col-xs-4</div>
      </div>
      <div class="row">
        <div class="col-xs-4">col-xs-4</div>
        <div class="col-xs-4">col-xs-4</div>
        <div class="col-xs-4">col-xs-4</div>
      </div>
  </div>

<!-- 列偏移 -->
  <div class="container">
    <div class="row">
      <div class="col-xs-3 col-xs-offset-3 bg-info" >col-xs-3</div>
      <div class="col-xs-3 col-xs-offset-3 bg-info">col-xs-3</div>
    </div>
  </div>

<br>
<!-- 嵌套列 -->
      <div class="row">
        <div class="col-sm-8 bg-primary">col-xs-8</div> 
        <div class="row">
          <div class="col-xs-4 col-sm-6 bg-success" >col-xs-4</div> 
          <div class="col-xs-8 col-sm-6 bg-info">col-xs-4</div> 
        </div>      
  </div>
  <br>
<!-- 列排序 -->
  <div class="row">
    <div class="col-md-9 col-md-push-3 bg-warning">col-md-9 col-md-push-3</div>
    <div class="col-md-3 col-md-pull-9 bg-danger">col-md-3 col-md-pull-9</div>
  </div>

<br>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

  

posted @ 2016-11-20 11:30  米小玉  阅读(160)  评论(0编辑  收藏  举报