carousel.html 11 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
layout: example
title: Carousel template
---

<!-- Custom styles for this template -->
<style>

/* GLOBAL STYLES
-------------------------------------------------- */
/* Padding below the footer and lighter body text */

body {
  padding-bottom: 40px;
  color: #5a5a5a;
}



/* CUSTOMIZE THE NAVBAR
-------------------------------------------------- */

/* Special class on .container surrounding .navbar, used for positioning it into place. */
.navbar-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}


33

34
35
36
37
38
39
40
/* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */

/* Carousel base class */
.carousel {
  margin-bottom: 60px;
}
41
42
43
/* Since positioning the image, we need to help out the caption */
.carousel-caption {
  z-index: 10;
44
45
}

46
/* Declare heights because of positioning of img element */
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.carousel .item {
  height: 500px;
}
.carousel img {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 100%;
  height: 500px;
}



/* MARKETING CONTENT
-------------------------------------------------- */

63
64
65
66
67
68
/* Pad the edges of the mobile views a bit */
.marketing {
  padding-left: 15px;
  padding-right: 15px;
}

69
/* Center align the text within the three columns below the carousel */
70
.marketing .col-lg-4 {
71
  text-align: center;
72
  margin-bottom: 20px;
73
74
75
76
}
.marketing h2 {
  font-weight: normal;
}
77
.marketing .col-lg-4 p {
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
  margin-left: 10px;
  margin-right: 10px;
}


/* Featurettes
------------------------- */

.featurette-divider {
  margin: 80px 0; /* Space out the Bootstrap <hr> more */
}
.featurette {
  padding-top: 120px; /* Vertically center images part 1: add padding above and below text. */
  overflow: hidden; /* Vertically center images part 2: clear their floats. */
}
.featurette-image {
  margin-top: -120px; /* Vertically center images part 3: negative margin up the image the same amount of the padding to center it. */
}

/* Give some space on the sides of the floated elements so text doesn't run right into it. */
.featurette-image.pull-left {
  margin-right: 40px;
}
.featurette-image.pull-right {
  margin-left: 40px;
}

/* Thin out the marketing headings */
.featurette-heading {
  font-size: 50px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -1px;
}



/* RESPONSIVE CSS
-------------------------------------------------- */

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
@media (min-width: 768px) {

  /* Remve the edge padding needed for mobile */
  .marketing {
    padding-left: 0;
    padding-right: 0;
  }

  /* Navbar positioning foo */
  .navbar-wrapper {
    margin-top: 20px;
    margin-bottom: -90px; /* Negative margin to pull up carousel. 90px is roughly margins and height of navbar. */
  }
  /* The navbar becomes detached from the top, so we round the corners */
  .navbar-wrapper .navbar {
    border-radius: 4px;
  }

  /* Bump up size of carousel content */
  .carousel-caption p {
    margin-bottom: 20px;
    font-size: 21px;
    line-height: 1.4;
  }

}


/*@media (max-width: 979px) {
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202

  .container.navbar-wrapper {
    margin-bottom: 0;
    width: auto;
  }

  .carousel .item {
    height: 500px;
  }
  .carousel img {
    width: auto;
    height: 500px;
  }

  .featurette {
    height: auto;
    padding: 0;
  }
  .featurette-image.pull-left,
  .featurette-image.pull-right {
    display: block;
    float: none;
    max-width: 40%;
    margin: 0 auto 20px;
  }
}


@media (max-width: 767px) {

  .carousel {
    margin-left: -20px;
    margin-right: -20px;
  }
  .carousel .container {

  }
  .carousel .item {
    height: 300px;
  }
  .carousel img {
    height: 300px;
  }
  .carousel-caption {
    width: 65%;
    padding: 0 70px;
    margin-top: 100px;
  }
  .carousel-caption h1 {
    font-size: 30px;
  }
  .carousel-caption .lead,
  .carousel-caption .btn {
    font-size: 18px;
  }

203
  .marketing .col-span-4 + .col-span-4 {
204
205
206
207
208
209
210
211
212
213
    margin-top: 40px;
  }

  .featurette-heading {
    font-size: 30px;
  }
  .featurette .lead {
    font-size: 18px;
    line-height: 1.5;
  }
214

215
216
217
218
219
220
221
  .navbar-wrapper {
    margin-top: 0;
  }

  .navbar {
    border-radius: 0;
  }
222

223
224
225
  #myCarousel {
    margin-top: 54px;
  }
226

227
}*/
228
229
230
231
232
233
234
235
236
</style>



<!-- NAVBAR
================================================== -->
<div class="navbar-wrapper">
  <div class="container">

237
    <div class="navbar navbar-inverse navbar-static-top">
238
239
240
241
242
243
      <div class="container">
	    <a class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
	      <span class="icon-bar"></span>
	      <span class="icon-bar"></span>
	      <span class="icon-bar"></span>
	    </a>
244
        <a class="navbar-brand" href="#">Project name</a>
245
        <div class="nav-collapse collapse">
246
          <ul class="nav navbar-nav">
247
248
249
250
251
252
253
254
255
256
257
258
259
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li class="divider"></li>
                <li class="nav-header">Nav header</li>
                <li><a href="#">Separated link</a></li>
                <li><a href="#">One more separated link</a></li>
Mark Otto's avatar
Mark Otto committed
260
              </ul>
261
262
            </li>
          </ul>
263
264
265
        </div>
      </div>
    </div>
266

267
268
  </div>
</div>
269
270
271
272
273


<!-- Carousel
================================================== -->
<div id="myCarousel" class="carousel slide">
274
275
276
277
278
279
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
    <li data-target="#myCarousel" data-slide-to="1"></li>
    <li data-target="#myCarousel" data-slide-to="2"></li>
  </ol>
280
281
  <div class="carousel-inner">
    <div class="item active">
282
      <img data-src="holder.js/1500x500/auto/#777:#7a7a7a/text:First slide" alt="">
283
284
285
      <div class="container">
        <div class="carousel-caption">
          <h1>Example headline.</h1>
286
287
          <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
          <p><a class="btn btn-large btn-primary" href="#">Sign up today</a></p>
Mark Otto's avatar
Mark Otto committed
288
        </div>
289
290
291
      </div>
    </div>
    <div class="item">
292
      <img data-src="holder.js/1500x500/auto/#777:#7a7a7a/text:Second slide" alt="">
293
294
295
      <div class="container">
        <div class="carousel-caption">
          <h1>Another example headline.</h1>
296
297
          <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
          <p><a class="btn btn-large btn-primary" href="#">Learn more</a></p>
Mark Otto's avatar
Mark Otto committed
298
299
        </div>
      </div>
300
301
    </div>
    <div class="item">
302
      <img data-src="holder.js/1500x500/auto/#777:#7a7a7a/text:Third slide" alt="">
303
304
305
      <div class="container">
        <div class="carousel-caption">
          <h1>One more for good measure.</h1>
306
307
          <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
          <p><a class="btn btn-large btn-primary" href="#">Browse gallery</a></p>
308
        </div>
Mark Otto's avatar
Mark Otto committed
309
      </div>
310
311
    </div>
  </div>
312
313
  <a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
  <a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
314
</div><!-- /.carousel -->
Mark Otto's avatar
Mark Otto committed
315
316
317



318
319
320
<!-- Marketing messaging and featurettes
================================================== -->
<!-- Wrap the rest of the page in another container to center all the content. -->
Mark Otto's avatar
Mark Otto committed
321

322
323
324
325
<div class="container marketing">

  <!-- Three columns of text below the carousel -->
  <div class="row">
326
    <div class="col col-lg-4">
327
328
      <img class="img-circle" data-src="holder.js/140x140">
      <h2>Heading</h2>
329
      <p>Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.</p>
Robert Burns's avatar
Robert Burns committed
330
      <p><a class="btn btn-default" href="#">View details &raquo;</a></p>
331
332
    </div><!-- /.col-lg-4 -->
    <div class="col col-lg-4">
333
334
      <img class="img-circle" data-src="holder.js/140x140">
      <h2>Heading</h2>
335
      <p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>
Robert Burns's avatar
Robert Burns committed
336
      <p><a class="btn btn-default" href="#">View details &raquo;</a></p>
337
338
    </div><!-- /.col-lg-4 -->
    <div class="col col-lg-4">
339
340
341
      <img class="img-circle" data-src="holder.js/140x140">
      <h2>Heading</h2>
      <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
Robert Burns's avatar
Robert Burns committed
342
      <p><a class="btn btn-default" href="#">View details &raquo;</a></p>
343
    </div><!-- /.col-lg-4 -->
344
345
346
347
348
349
350
351
  </div><!-- /.row -->


  <!-- START THE FEATURETTES -->

  <hr class="featurette-divider">

  <div class="featurette">
352
    <img class="featurette-image img-circle pull-right" data-src="holder.js/512x512">
Seth Lilly's avatar
Seth Lilly committed
353
    <h2 class="featurette-heading">First featurette heading. <span class="text-muted">It'll blow your mind.</span></h2>
354
355
356
357
358
359
    <p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
  </div>

  <hr class="featurette-divider">

  <div class="featurette">
360
    <img class="featurette-image img-circle pull-left" data-src="holder.js/512x512">
Mark Otto's avatar
Mark Otto committed
361
    <h2 class="featurette-heading">Oh yeah, it's that good. <span class="text-muted">See for yourself.</span></h2>
362
363
364
365
366
367
    <p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
  </div>

  <hr class="featurette-divider">

  <div class="featurette">
368
    <img class="featurette-image img-circle pull-right" data-src="holder.js/512x512">
Mark Otto's avatar
Mark Otto committed
369
    <h2 class="featurette-heading">And lastly, this one. <span class="text-muted">Checkmate.</span></h2>
370
371
372
373
374
375
376
377
378
379
380
381
382
    <p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
  </div>

  <hr class="featurette-divider">

  <!-- /END THE FEATURETTES -->


  <!-- FOOTER -->
  <footer>
    <p class="pull-right"><a href="#">Back to top</a></p>
    <p>&copy; 2013 Company, Inc. &middot; <a href="#">Privacy</a> &middot; <a href="#">Terms</a></p>
  </footer>
Mark Otto's avatar
Mark Otto committed
383

384
</div><!-- /.container -->