Grid Template


SUBMITTED BY: Guest

DATE: Nov. 13, 2013, 8:29 p.m.

FORMAT: Text only

SIZE: 6.8 kB

HITS: 3920

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="description" content="">
  8. <meta name="author" content="">
  9. <link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
  10. <title>Grid Template for Bootstrap</title>
  11. <!-- Bootstrap core CSS -->
  12. <link href="../../dist/css/bootstrap.css" rel="stylesheet">
  13. <!-- Custom styles for this template -->
  14. <link href="grid.css" rel="stylesheet">
  15. <!-- Just for debugging purposes. Don't actually copy this line! -->
  16. <!--[if lt IE 9]><script src="../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
  17. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  18. <!--[if lt IE 9]>
  19. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  20. <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
  21. <![endif]-->
  22. </head>
  23. <body>
  24. <div class="container">
  25. <div class="page-header">
  26. <h1>Bootstrap grid examples</h1>
  27. <p class="lead">Basic grid layouts to get you familiar with building within the Bootstrap grid system.</p>
  28. </div>
  29. <h3>Three equal columns</h3>
  30. <p>Get three equal-width columns <strong>starting at desktops and scaling to large desktops</strong>. On mobile devices, tablets and below, the columns will automatically stack.</p>
  31. <div class="row">
  32. <div class="col-md-4">.col-md-4</div>
  33. <div class="col-md-4">.col-md-4</div>
  34. <div class="col-md-4">.col-md-4</div>
  35. </div>
  36. <h3>Three unequal columns</h3>
  37. <p>Get three columns <strong>starting at desktops and scaling to large desktops</strong> of various widths. Remember, grid columns should add up to twelve for a single horizontal block. More than that, and columns start stacking no matter the viewport.</p>
  38. <div class="row">
  39. <div class="col-md-3">.col-md-3</div>
  40. <div class="col-md-6">.col-md-6</div>
  41. <div class="col-md-3">.col-md-3</div>
  42. </div>
  43. <h3>Two columns</h3>
  44. <p>Get two columns <strong>starting at desktops and scaling to large desktops</strong>.</p>
  45. <div class="row">
  46. <div class="col-md-8">.col-md-8</div>
  47. <div class="col-md-4">.col-md-4</div>
  48. </div>
  49. <h3>Full width, single column</h3>
  50. <p class="text-warning">No grid classes are necessary for full-width elements.</p>
  51. <hr>
  52. <h3>Two columns with two nested columns</h3>
  53. <p>Per the documentation, nesting is easy—just put a row of columns within an existing row. This gives you two columns <strong>starting at desktops and scaling to large desktops</strong>, with another two (equal widths) within the larger column.</p>
  54. <p>At mobile device sizes, tablets and down, these columns and their nested columns will stack.</p>
  55. <div class="row">
  56. <div class="col-md-8">
  57. .col-md-8
  58. <div class="row">
  59. <div class="col-md-6">.col-md-6</div>
  60. <div class="col-md-6">.col-md-6</div>
  61. </div>
  62. </div>
  63. <div class="col-md-4">.col-md-4</div>
  64. </div>
  65. <hr>
  66. <h3>Mixed: mobile and desktop</h3>
  67. <p>The Bootstrap 3 grid system has four tiers of classes: xs (phones), sm (tablets), md (desktops), and lg (larger desktops). You can use nearly any combination of these classes to create more dynamic and flexible layouts.</p>
  68. <p>Each tier of classes scales up, meaning if you plan on setting the same widths for xs and sm, you only need to specify xs.</p>
  69. <div class="row">
  70. <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
  71. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  72. </div>
  73. <div class="row">
  74. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  75. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  76. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  77. </div>
  78. <div class="row">
  79. <div class="col-xs-6">.col-xs-6</div>
  80. <div class="col-xs-6">.col-xs-6</div>
  81. </div>
  82. <hr>
  83. <h3>Mixed: mobile, tablet, and desktop</h3>
  84. <p></p>
  85. <div class="row">
  86. <div class="col-xs-12 col-sm-6 col-lg-8">.col-xs-12 .col-sm-6 .col-lg-8</div>
  87. <div class="col-xs-6 col-lg-4">.col-xs-6 .col-lg-4</div>
  88. </div>
  89. <div class="row">
  90. <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  91. <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  92. <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  93. </div>
  94. <hr>
  95. <h3>Column clearing</h3>
  96. <p>Clear floats at specific breakpoints to prevent awkward wrapping with uneven content.</p>
  97. <div class="row">
  98. <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  99. <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  100. <!-- Add the extra clearfix for only the required viewport -->
  101. <div class="clearfix visible-xs"></div>
  102. <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  103. <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  104. </div>
  105. <hr>
  106. <h3>Offset, push, and pull resets</h3>
  107. <p>Reset offsets, pushes, and pulls at specific breakpoints.</p>
  108. <div class="row">
  109. <div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
  110. <div class="col-sm-5 col-sm-offset-2 col-md-6 col-md-offset-0">.col-sm-5 .col-sm-offset-2 .col-md-6 .col-md-offset-0</div>
  111. </div>
  112. <div class="row">
  113. <div class="col-sm-6 col-md-5 col-lg-6">.col-sm-6 .col-md-5 .col-lg-6</div>
  114. <div class="col-sm-6 col-md-5 col-md-offset-2 col-lg-6 col-lg-offset-0">.col-sm-6 .col-md-5 .col-md-offset-2 .col-lg-6 .col-lg-offset-0</div>
  115. </div>
  116. </div> <!-- /container -->
  117. <!-- Bootstrap core JavaScript
  118. ================================================== -->
  119. <!-- Placed at the end of the document so the pages load faster -->
  120. </body>
  121. </html>

comments powered by Disqus