Advertisement
davidbenjamin998

Bootstrap Carousel

Apr 2nd, 2013
1,682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 15.67 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="utf-8">
  5.     <title>Carousel Template &middot; Bootstrap</title>
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <meta name="description" content="">
  8.     <meta name="author" content="">
  9.  
  10.     <!-- Le styles -->
  11.     <script type="text/javascript" src="js/bootstrap.js"></script>
  12.     <script type="text/javascript" src="js/bootstrap.min.js"></script>
  13.    
  14.     <link href="css/bootstrap.css" rel="stylesheet">
  15.     <link href="css/bootstrap-responsive.css" rel="stylesheet">
  16.     <style>
  17.  
  18.     /* GLOBAL STYLES
  19.     -------------------------------------------------- */
  20.     /* Padding below the footer and lighter body text */
  21.  
  22.     body {
  23.       padding-bottom: 40px;
  24.       color: #5a5a5a;
  25.     }
  26.  
  27.  
  28.  
  29.     /* CUSTOMIZE THE NAVBAR
  30.     -------------------------------------------------- */
  31.  
  32.     /* Special class on .container surrounding .navbar, used for positioning it into place. */
  33.     .navbar-wrapper {
  34.       position: absolute;
  35.       top: 0;
  36.       left: 0;
  37.       right: 0;
  38.       z-index: 10;
  39.       margin-top: 20px;
  40.       margin-bottom: -90px; /* Negative margin to pull up carousel. 90px is roughly margins and height of navbar. */
  41.     }
  42.     .navbar-wrapper .navbar {
  43.  
  44.     }
  45.  
  46.     /* Remove border and change up box shadow for more contrast */
  47.     .navbar .navbar-inner {
  48.       border: 0;
  49.       -webkit-box-shadow: 0 2px 10px rgba(0,0,0,.25);
  50.          -moz-box-shadow: 0 2px 10px rgba(0,0,0,.25);
  51.               box-shadow: 0 2px 10px rgba(0,0,0,.25);
  52.     }
  53.  
  54.     /* Downsize the brand/project name a bit */
  55.     .navbar .brand {
  56.       padding: 14px 20px 16px; /* Increase vertical padding to match navbar links */
  57.       font-size: 16px;
  58.       font-weight: bold;
  59.       text-shadow: 0 -1px 0 rgba(0,0,0,.5);
  60.     }
  61.  
  62.     /* Navbar links: increase padding for taller navbar */
  63.     .navbar .nav > li > a {
  64.       padding: 15px 20px;
  65.     }
  66.  
  67.     /* Offset the responsive button for proper vertical alignment */
  68.     .navbar .btn-navbar {
  69.       margin-top: 10px;
  70.     }
  71.  
  72.  
  73.  
  74.     /* CUSTOMIZE THE CAROUSEL
  75.     -------------------------------------------------- */
  76.  
  77.     /* Carousel base class */
  78.     .carousel {
  79.       margin-bottom: 60px;
  80.     }
  81.  
  82.     .carousel .container {
  83.       position: relative;
  84.       z-index: 9;
  85.     }
  86.  
  87.     .carousel-control {
  88.       height: 80px;
  89.       margin-top: 0;
  90.       font-size: 120px;
  91.       text-shadow: 0 1px 1px rgba(0,0,0,.4);
  92.       background-color: transparent;
  93.       border: 0;
  94.       z-index: 10;
  95.     }
  96.  
  97.     .carousel .item {
  98.       height: 500px;
  99.     }
  100.     .carousel img {
  101.       position: absolute;
  102.       top: 0;
  103.       left: 0;
  104.       min-width: 100%;
  105.       height: 500px;
  106.     }
  107.  
  108.     .carousel-caption {
  109.       background-color: transparent;
  110.       position: static;
  111.       max-width: 550px;
  112.       padding: 0 20px;
  113.       margin-top: 200px;
  114.     }
  115.     .carousel-caption h1,
  116.     .carousel-caption .lead {
  117.       margin: 0;
  118.       line-height: 1.25;
  119.       color: #fff;
  120.       text-shadow: 0 1px 1px rgba(0,0,0,.4);
  121.     }
  122.     .carousel-caption .btn {
  123.       margin-top: 10px;
  124.     }
  125.  
  126.  
  127.  
  128.     /* MARKETING CONTENT
  129.     -------------------------------------------------- */
  130.  
  131.     /* Center align the text within the three columns below the carousel */
  132.     .marketing .span4 {
  133.       text-align: center;
  134.     }
  135.     .marketing h2 {
  136.       font-weight: normal;
  137.     }
  138.     .marketing .span4 p {
  139.       margin-left: 10px;
  140.       margin-right: 10px;
  141.     }
  142.  
  143.  
  144.     /* Featurettes
  145.     ------------------------- */
  146.  
  147.     .featurette-divider {
  148.       margin: 80px 0; /* Space out the Bootstrap <hr> more */
  149.     }
  150.     .featurette {
  151.       padding-top: 120px; /* Vertically center images part 1: add padding above and below text. */
  152.       overflow: hidden; /* Vertically center images part 2: clear their floats. */
  153.     }
  154.     .featurette-image {
  155.       margin-top: -120px; /* Vertically center images part 3: negative margin up the image the same amount of the padding to center it. */
  156.     }
  157.  
  158.     /* Give some space on the sides of the floated elements so text doesn't run right into it. */
  159.     .featurette-image.pull-left {
  160.       margin-right: 40px;
  161.     }
  162.     .featurette-image.pull-right {
  163.       margin-left: 40px;
  164.     }
  165.  
  166.     /* Thin out the marketing headings */
  167.     .featurette-heading {
  168.       font-size: 50px;
  169.       font-weight: 300;
  170.       line-height: 1;
  171.       letter-spacing: -1px;
  172.     }
  173.  
  174.  
  175.  
  176.     /* RESPONSIVE CSS
  177.     -------------------------------------------------- */
  178.  
  179.     @media (max-width: 979px) {
  180.  
  181.       .container.navbar-wrapper {
  182.         margin-bottom: 0;
  183.         width: auto;
  184.       }
  185.       .navbar-inner {
  186.         border-radius: 0;
  187.         margin: -20px 0;
  188.       }
  189.  
  190.       .carousel .item {
  191.         height: 500px;
  192.       }
  193.       .carousel img {
  194.         width: auto;
  195.         height: 500px;
  196.       }
  197.  
  198.       .featurette {
  199.         height: auto;
  200.         padding: 0;
  201.       }
  202.       .featurette-image.pull-left,
  203.       .featurette-image.pull-right {
  204.         display: block;
  205.         float: none;
  206.         max-width: 40%;
  207.         margin: 0 auto 20px;
  208.       }
  209.     }
  210.  
  211.  
  212.     @media (max-width: 767px) {
  213.  
  214.       .navbar-inner {
  215.         margin: -20px;
  216.       }
  217.  
  218.       .carousel {
  219.         margin-left: -20px;
  220.         margin-right: -20px;
  221.       }
  222.       .carousel .container {
  223.  
  224.       }
  225.       .carousel .item {
  226.         height: 300px;
  227.       }
  228.       .carousel img {
  229.         height: 300px;
  230.       }
  231.       .carousel-caption {
  232.         width: 65%;
  233.         padding: 0 70px;
  234.         margin-top: 100px;
  235.       }
  236.       .carousel-caption h1 {
  237.         font-size: 30px;
  238.       }
  239.       .carousel-caption .lead,
  240.       .carousel-caption .btn {
  241.         font-size: 18px;
  242.       }
  243.  
  244.       .marketing .span4 + .span4 {
  245.         margin-top: 40px;
  246.       }
  247.  
  248.       .featurette-heading {
  249.         font-size: 30px;
  250.       }
  251.       .featurette .lead {
  252.         font-size: 18px;
  253.         line-height: 1.5;
  254.       }
  255.  
  256.     }
  257.     </style>
  258.  
  259.     <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  260.     <!--[if lt IE 9]>
  261.      <script src="../assets/js/html5shiv.js"></script>
  262.    <![endif]-->
  263.  
  264.     <!-- Fav and touch icons -->
  265.     <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
  266.     <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
  267.       <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
  268.                     <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
  269.                                    <link rel="shortcut icon" href="../assets/ico/favicon.png">
  270.   </head>
  271.  
  272.   <body>
  273.  
  274.  
  275.  
  276.     <!-- NAVBAR
  277.    ================================================== -->
  278.     <div class="navbar-wrapper">
  279.       <!-- Wrap the .navbar in .container to center it within the absolutely positioned parent. -->
  280.       <div class="container">
  281.  
  282.         <div class="navbar navbar-inverse">
  283.           <div class="navbar-inner">
  284.             <!-- Responsive Navbar Part 1: Button for triggering responsive navbar (not covered in tutorial). Include responsive CSS to utilize. -->
  285.             <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  286.               <span class="icon-bar"></span>
  287.               <span class="icon-bar"></span>
  288.               <span class="icon-bar"></span>
  289.             </button>
  290.             <a class="brand" href="#">Project name</a>
  291.             <!-- Responsive Navbar Part 2: Place all navbar contents you want collapsed withing .navbar-collapse.collapse. -->
  292.             <div class="nav-collapse collapse">
  293.               <ul class="nav">
  294.                 <li class="active"><a href="#">Home</a></li>
  295.                 <li><a href="#about">About</a></li>
  296.                 <li><a href="#contact">Contact</a></li>
  297.                 <!-- Read about Bootstrap dropdowns at http://twitter.github.com/bootstrap/javascript.html#dropdowns -->
  298.                 <li class="dropdown">
  299.                   <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
  300.                   <ul class="dropdown-menu">
  301.                     <li><a href="#">Action</a></li>
  302.                     <li><a href="#">Another action</a></li>
  303.                     <li><a href="#">Something else here</a></li>
  304.                     <li class="divider"></li>
  305.                     <li class="nav-header">Nav header</li>
  306.                     <li><a href="#">Separated link</a></li>
  307.                     <li><a href="#">One more separated link</a></li>
  308.                   </ul>
  309.                 </li>
  310.               </ul>
  311.             </div><!--/.nav-collapse -->
  312.           </div><!-- /.navbar-inner -->
  313.         </div><!-- /.navbar -->
  314.  
  315.       </div> <!-- /.container -->
  316.     </div><!-- /.navbar-wrapper -->
  317.  
  318.  
  319.  
  320.     <!-- Carousel
  321.    ================================================== -->
  322.     <div id="myCarousel" class="carousel slide">
  323.       <div class="carousel-inner">
  324.         <div class="item active">
  325.           <img src="screenshots/activities2.png" alt="">
  326.           <div class="container">
  327.             <div class="carousel-caption">
  328.               <h1>Example headline.</h1>
  329.               <p class="lead">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>
  330.               <a class="btn btn-large btn-primary" href="#">Sign up today</a>
  331.             </div>
  332.           </div>
  333.         </div>
  334.         <div class="item">
  335.           <img src="screenshots/home.png" alt="">
  336.           <div class="container">
  337.             <div class="carousel-caption">
  338.               <h1>Another example headline.</h1>
  339.               <p class="lead">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>
  340.               <a class="btn btn-large btn-primary" href="#">Learn more</a>
  341.             </div>
  342.           </div>
  343.         </div>
  344.         <div class="item">
  345.           <img src="screenshots/IM.png" alt="">
  346.           <div class="container">
  347.             <div class="carousel-caption">
  348.               <h1>One more for good measure.</h1>
  349.               <p class="lead">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>
  350.               <a class="btn btn-large btn-primary" href="#">Browse gallery</a>
  351.             </div>
  352.           </div>
  353.         </div>
  354.       </div>
  355.       <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
  356.       <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>
  357.     </div><!-- /.carousel -->
  358.  
  359.  
  360.  
  361.     <!-- Marketing messaging and featurettes
  362.    ================================================== -->
  363.     <!-- Wrap the rest of the page in another container to center all the content. -->
  364.  
  365.     <div class="container marketing">
  366.  
  367.       <!-- Three columns of text below the carousel -->
  368.       <div class="row">
  369.         <div class="span4">
  370.           <img class="img-circle" data-src="holder.js/140x140">
  371.           <h2>Heading</h2>
  372.           <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, vel scelerisque nisl consectetur et.</p>
  373.           <p><a class="btn" href="#">View details &raquo;</a></p>
  374.         </div><!-- /.span4 -->
  375.         <div class="span4">
  376.           <img class="img-circle" data-src="holder.js/140x140">
  377.           <h2>Heading</h2>
  378.           <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, ut fermentum massa justo sit amet risus.</p>
  379.           <p><a class="btn" href="#">View details &raquo;</a></p>
  380.         </div><!-- /.span4 -->
  381.         <div class="span4">
  382.           <img class="img-circle" data-src="holder.js/140x140">
  383.           <h2>Heading</h2>
  384.           <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>
  385.           <p><a class="btn" href="#">View details &raquo;</a></p>
  386.         </div><!-- /.span4 -->
  387.       </div><!-- /.row -->
  388.  
  389.  
  390.       <!-- START THE FEATURETTES -->
  391.  
  392.       <hr class="featurette-divider">
  393.  
  394.       <div class="featurette">
  395.         <img class="featurette-image pull-right" src="../assets/img/examples/browser-icon-chrome.png">
  396.         <h2 class="featurette-heading">First featurette headling. <span class="muted">It'll blow your mind.</span></h2>
  397.         <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>
  398.       </div>
  399.  
  400.       <hr class="featurette-divider">
  401.  
  402.       <div class="featurette">
  403.         <img class="featurette-image pull-left" src="../assets/img/examples/browser-icon-firefox.png">
  404.         <h2 class="featurette-heading">Oh yeah, it's that good. <span class="muted">See for yourself.</span></h2>
  405.         <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>
  406.       </div>
  407.  
  408.       <hr class="featurette-divider">
  409.  
  410.       <div class="featurette">
  411.         <img class="featurette-image pull-right" src="../assets/img/examples/browser-icon-safari.png">
  412.         <h2 class="featurette-heading">And lastly, this one. <span class="muted">Checkmate.</span></h2>
  413.         <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>
  414.       </div>
  415.  
  416.       <hr class="featurette-divider">
  417.  
  418.       <!-- /END THE FEATURETTES -->
  419.  
  420.  
  421.       <!-- FOOTER -->
  422.       <footer>
  423.         <p class="pull-right"><a href="#">Back to top</a></p>
  424.         <p>&copy; 2013 Company, Inc. &middot; <a href="#">Privacy</a> &middot; <a href="#">Terms</a></p>
  425.       </footer>
  426.  
  427.     </div><!-- /.container -->
  428.  
  429.  
  430.  
  431.     <!-- Le javascript
  432.    ================================================== -->
  433.     <!-- Placed at the end of the document so the pages load faster -->
  434.     <script src="js/jquery.js"></script>
  435.     <script src="js/bootstrap-transition.js"></script>
  436.     <script src="js/bootstrap-alert.js"></script>
  437.     <script src="js/bootstrap-modal.js"></script>
  438.     <script src="js/bootstrap-dropdown.js"></script>
  439.     <script src="js/bootstrap-scrollspy.js"></script>
  440.     <script src="js/bootstrap-tab.js"></script>
  441.     <script src="js/bootstrap-tooltip.js"></script>
  442.     <script src="js/bootstrap-popover.js"></script>
  443.     <script src="js/bootstrap-button.js"></script>
  444.     <script src="js/bootstrap-collapse.js"></script>
  445.     <script src="js/bootstrap-carousel.js"></script>
  446.     <script src="js/bootstrap-typeahead.js"></script>
  447.     <script>
  448.       !function ($) {
  449.         $(function(){
  450.           // carousel demo
  451.           $('#myCarousel').carousel()
  452.         })
  453.       }(window.jQuery)
  454.     </script>
  455.     <script src="js/holder/holder.js"></script>
  456.   </body>
  457. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement