Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Bootstrap Carousel with Tabbed Navigation</title> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Oswald:300,400|Roboto:300,400,700"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script> <style> .carousel { margin: 30px 0; background: #ccc; } .carousel .carousel-item { text-align: center; overflow: hidden; height: 475px; } .carousel .carousel-item img { max-width: 100%; margin: 0 auto; /* Align slide image horizontally center in Bootstrap v3 */ } .carousel-caption h3, .carousel-caption p { color: #fff; display: inline-block; font-family: 'Oswald', sans-serif; text-shadow: none; margin-bottom: 20px; } .carousel-caption h3 { background: rgba(0,0,0,0.9); padding: 12px 24px; font-size: 40px; text-transform: uppercase; } .carousel-caption p { background: #20b0b9; padding: 10px 20px; font-size: 20px; font-weight: 300; } .carousel .nav { background: #eee; } .carousel .nav a { color: #333; border-radius: 0; font-size: 85%; padding: 10px 16px; background: transparent; } .carousel .nav .active a { color: #fff; background: #20b0b9; } .carousel .nav strong { display: block; font-family: 'Roboto', sans-serif; font-size: 110%; text-transform: uppercase; } </style> <script> $(document).ready(function(){ // Highlight bottom nav links var clickEvent = false; $("#myCarousel").on("click", ".nav a", function(){ clickEvent = true; $(this).parent().siblings().removeClass("active"); $(this).parent().addClass("active"); }).on("slid.bs.carousel", function(e){ if(!clickEvent){ itemIndex = $(e.relatedTarget).index(); targetNavItem = $(".nav li[data-slide-to='" + itemIndex + "']"); $(".nav li").not(targetNavItem).removeClass("active"); targetNavItem.addClass("active"); } clickEvent = false; }); }); </script> </head> <body> <div class="container-lg"> <div class="row"> <div class="col-md-12"> <div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Wrapper for carousel items --> <div class="carousel-inner"> <div class="carousel-item active"> <img src="/examples/images/slides/notebook.jpg" class="img-fluid" alt="Notebook"> <div class="carousel-caption"> <h3>Amazing Digital Experience</h3> <p>Pulvinar leo id risus pellentesque vestibulum. Sed diam libero, sodales eget sapien bibendum.</p> </div> </div> <div class="carousel-item"> <img src="/examples/images/slides/tablet.jpg" class="img-fluid" alt="Tablet"> <div class="carousel-caption"> <h3>Live Monitoring Tools</h3> <p>Nullam hendrerit justo non leo aliquet imperdiet. Etiam sagittis lectus condime dapibus vitae.</p> </div> </div> <div class="carousel-item"> <img src="/examples/images/slides/workstation.jpg" class="img-fluid" alt="Workstation"> <div class="carousel-caption"> <h3>Attractive Pricing</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam pellentesque tempor quis.</p> </div> </div> <div class="carousel-item"> <img src="/examples/images/slides/report.jpg" class="img-fluid" alt="Report"> <div class="carousel-caption"> <h3>Award Winning Support</h3> <p>Nullam hendrerit justo non leo aliquet imperdiet. Etiam in sagittis lectus ultrices placerat.</p> </div> </div> </div> <!-- Carousel controls --> <ol class="nav nav-pills nav-justified"> <li data-target="#myCarousel" data-slide-to="0" class="nav-item active"><a href="#" class="nav-link"><strong>About</strong>Lorem ipsum dolor sit amet</a></li> <li data-target="#myCarousel" data-slide-to="1" class="nav-item"><a href="#" class="nav-link"><strong>Features</strong> Nesciunt stumpown odio aliqua</a></li> <li data-target="#myCarousel" data-slide-to="2" class="nav-item"><a href="#" class="nav-link"><strong>Pricing</strong> Oullam hendrerit justom leow</a></li> <li data-target="#myCarousel" data-slide-to="3" class="nav-item"><a href="#" class="nav-link"><strong>Support</strong> Proin suscipit non adipiscing</a></li> </ol> </div> </div> </div> </div> </body> </html>