index.html 6.93 KB
Newer Older
1
2
3
4
<!DOCTYPE html>
<html lang="en">
  <head>
    <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, shrink-to-fit=no">
7
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
8
9
    <meta name="description" content="">
    <meta name="author" content="">
10
    <link rel="icon" href="../../favicon.ico">
11

Nicole's avatar
Nicole committed
12
    <title>Grid Template for Bootstrap</title>
13
14

    <!-- Bootstrap core CSS -->
wangsai's avatar
wangsai committed
15
    <link href="../../dist/css/bootstrap.min.css" rel="stylesheet">
16
17

    <!-- Custom styles for this template -->
Nicole's avatar
Nicole committed
18
    <link href="grid.css" rel="stylesheet">
19
20
21
22
23
  </head>

  <body>
    <div class="container">

24
25
26
27
      <div class="page-header">
        <h1>Bootstrap grid examples</h1>
        <p class="lead">Basic grid layouts to get you familiar with building within the Bootstrap grid system.</p>
      </div>
28

Mark Otto's avatar
Mark Otto committed
29
30
31
32
      <h3>Five grid tiers</h3>
      <p>There are five tiers to the Bootstrap grid system, one for each range of devices we support. Each tier starts at a minimum viewport size and automatically applies to the larger devices unless overridden.</p>

<div class="row">
33
34
35
  <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>
Mark Otto's avatar
Mark Otto committed
36
37
38
</div>

<div class="row">
39
40
41
  <div class="col-sm-4">.col-sm-4</div>
  <div class="col-sm-4">.col-sm-4</div>
  <div class="col-sm-4">.col-sm-4</div>
Mark Otto's avatar
Mark Otto committed
42
43
44
</div>

<div class="row">
45
46
47
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4">.col-md-4</div>
Mark Otto's avatar
Mark Otto committed
48
49
50
</div>

<div class="row">
51
52
53
  <div class="col-lg-4">.col-lg-4</div>
  <div class="col-lg-4">.col-lg-4</div>
  <div class="col-lg-4">.col-lg-4</div>
Mark Otto's avatar
Mark Otto committed
54
55
56
</div>

<div class="row">
57
58
59
  <div class="col-xl-4">.col-xl-4</div>
  <div class="col-xl-4">.col-xl-4</div>
  <div class="col-xl-4">.col-xl-4</div>
Mark Otto's avatar
Mark Otto committed
60
61
</div>

62
63
      <h3>Three equal columns</h3>
      <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>
64
      <div class="row">
65
66
67
        <div class="col-md-4">.col-md-4</div>
        <div class="col-md-4">.col-md-4</div>
        <div class="col-md-4">.col-md-4</div>
68
69
      </div>

70
71
      <h3>Three unequal columns</h3>
      <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>
72
      <div class="row">
73
74
75
        <div class="col-md-3">.col-md-3</div>
        <div class="col-md-6">.col-md-6</div>
        <div class="col-md-3">.col-md-3</div>
76
77
      </div>

78
79
      <h3>Two columns</h3>
      <p>Get two columns <strong>starting at desktops and scaling to large desktops</strong>.</p>
80
      <div class="row">
81
82
        <div class="col-md-8">.col-md-8</div>
        <div class="col-md-4">.col-md-4</div>
83
84
      </div>

85
      <h3>Full width, single column</h3>
86
87
      <p class="text-warning">No grid classes are necessary for full-width elements.</p>

88
89
90
      <hr>

      <h3>Two columns with two nested columns</h3>
Julian Thilo's avatar
Julian Thilo committed
91
      <p>Per the documentation, nesting is easy—just put a row of columns within an existing column. 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>
92
      <p>At mobile device sizes, tablets and down, these columns and their nested columns will stack.</p>
93
      <div class="row">
94
        <div class="col-md-8">
95
          .col-md-8
96
          <div class="row">
97
98
            <div class="col-md-6">.col-md-6</div>
            <div class="col-md-6">.col-md-6</div>
99
100
          </div>
        </div>
101
        <div class="col-md-4">.col-md-4</div>
102
103
      </div>

104
105
106
      <hr>

      <h3>Mixed: mobile and desktop</h3>
107
      <p>The Bootstrap v4 grid system has five tiers of classes: xs (extra small), sm (small), md (medium), lg (large), and xl (extra large). You can use nearly any combination of these classes to create more dynamic and flexible layouts.</p>
108
      <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>
109
      <div class="row">
110
111
        <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
        <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
112
113
      </div>
      <div class="row">
114
115
116
        <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
        <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
        <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
117
118
      </div>
      <div class="row">
119
120
        <div class="col-xs-6">.col-xs-6</div>
        <div class="col-xs-6">.col-xs-6</div>
121
122
      </div>

123
124
125
126
      <hr>

      <h3>Mixed: mobile, tablet, and desktop</h3>
      <p></p>
127
      <div class="row">
128
129
        <div class="col-xs-12 col-sm-6 col-lg-8">.col-xs-12 .col-sm-6 .col-lg-8</div>
        <div class="col-xs-6 col-lg-4">.col-xs-6 .col-lg-4</div>
130
131
      </div>
      <div class="row">
132
133
134
        <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
        <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
        <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
135
136
      </div>

137
138
139
      <hr>

      <h3>Column clearing</h3>
Mark Otto's avatar
Mark Otto committed
140
      <p><a href="http://getbootstrap.com/css/#grid-responsive-resets">Clear floats</a> at specific breakpoints to prevent awkward wrapping with uneven content.</p>
141
      <div class="row">
142
        <div class="col-xs-6 col-sm-3">
tomByrer's avatar
tomByrer committed
143
144
145
146
          .col-xs-6 .col-sm-3
          <br>
          Resize your viewport or check it out on your phone for an example.
        </div>
147
        <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
148
149

        <!-- Add the extra clearfix for only the required viewport -->
150
        <div class="clearfix hidden-sm-up"></div>
151

152
153
        <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
        <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
154
155
156
157
158
159
160
      </div>

      <hr>

      <h3>Offset, push, and pull resets</h3>
      <p>Reset offsets, pushes, and pulls at specific breakpoints.</p>
      <div class="row">
161
162
        <div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
        <div class="col-sm-5 offset-sm-2 col-md-6 offset-md-0">.col-sm-5 .col-sm-offset-2 .col-md-6 .col-md-offset-0</div>
163
164
      </div>
      <div class="row">
165
166
        <div class="col-sm-6 col-md-5 col-lg-6">.col-sm-6 .col-md-5 .col-lg-6</div>
        <div class="col-sm-6 col-md-5 offset-md-2 col-lg-6 offset-lg-0">.col-sm-6 .col-md-5 .col-md-offset-2 .col-lg-6 .col-lg-offset-0</div>
167
168
169
      </div>


170
171
    </div> <!-- /container -->

172
173
174
175

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
176
177
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
178
179
  </body>
</html>