Create carousel Full sized background Image

Description

The following code shows how to create carousel Full sized background Image.

Example


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-2.0.2.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
</head><!--from  ww  w.j a  va  2  s  . c om-->
<body>
  <div id="myCarousel" class="carousel slide">
    <!-- 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>
    <div class="carousel-inner">
      <div class="item active">
        <img src="http://placehold.it/1400x500" width='100%'>
        <div class="container">
          <div class="carousel-caption">
            <h1>Bootstrap 3 Carousel Layout</h1>
            <p>
              This is an example layout with carousel that uses the Bootstrap 3
              styles. <a title="Bootstrap 3" href="http://getbootstrap.com"
                class="">Bootstrap 3 RC 1 is now available!</a>
            </p>
            <p>
              <a class="btn btn-large btn-primary" href="#">Sign up today</a>
            </p>
          </div>
        </div>
      </div>
      <div class="item">
        <img src="http://placehold.it/1400x500">
        <div class="container">
          <div class="carousel-caption">
            <h1>Changes to the Grid</h1>
            <p>Bootstrap 3 still features a 12-column grid, but many of
              the CSS class names have completely changed.</p>
            <p>
              <a class="btn btn-large btn-primary" href="#">Learn more</a>
            </p>
          </div>
        </div>
      </div>
      <div class="item">
        <img src="http://placehold.it/1500X500">
        <div class="container">
          <div class="carousel-caption">
            <h1>Percentage-based sizing</h1>
            <p>With "mobile-first" there is now only one percentage-based
              grid.</p>
            <p>
              <a class="btn btn-large btn-primary" href="#">Browse gallery</a>
            </p>
          </div>
        </div>
      </div>
    </div>
    <!-- Controls -->
    <a class="left carousel-control" href="#myCarousel" data-slide="prev">
      <span class="icon-prev"></span>
    </a> <a class="right carousel-control" href="#myCarousel"
      data-slide="next"> <span class="icon-next"></span>
    </a>
  </div>
  <!-- Post Info -->
  <div
    style='position: fixed; bottom: 0; left: 0; background: lightgray; width: 100%;'>
    About this SO Question: <a
      href='http://stackoverflow.com/q/18559682/1366033'>Twitter
      Bootstrap Carousel Grey Bars</a><br/> Find documentation: <a
      href='http://getbootstrap.com/css/'>Get Bootstrap 3.0</a><br />
    External JS File: <a
      href='http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js'>bootstrap.min.js</a><br />
    External Style Sheet: <a
      href='http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js'>bootstrap.min.css</a><br />
    External Fonts / Icons: <a
      href='http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css'>font-awesome.min.css</a>
    <div>
</body>
</html>

Click to view the demo





















Home »
  Bootstrap »
    Example »




Accordion
Alert
Auto Complete
Badge
Breadcrum
Button
Carousel
Collapse
Dialog
Dropdown
Form
Icon
Jumbotron
Label
Layout
List
List Group
Media
Navigation Bar
Pager
Page Header
Panel
Paragraph
Pills
Popover
ProgressBar
ScrollSpy
Switch
Tab
Table
Thumnail
Tooltip
Tree
Well