如何在HTML5中制作类似于此网站https://thecubicle.us/的滑动框?

时间:2018-09-11 03:04:53

标签: html css

因此,我想制作一个类似于此网站的滑动框:“ https://thecubicle.us/”。我该如何做HTML5?如果涉及其他语言,请对我有所帮助,因为HTML是我所知道的唯一编程语言。

谢谢, PleaseHelpMeImANoob2

1 个答案:

答案 0 :(得分:0)

请参见下面的代码并使用它:

You can take the following code for your query:
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Carousel Example</h2>  
  <div id="myCarousel" class="carousel slide" data-ride="carousel">
    <!-- 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>

    <!-- Wrapper for slides -->
    <div class="carousel-inner">
      <div class="item active">
       <!-- <img src="la.jpg" alt="Los Angeles" style="width:100%;">-->
         <center>
           <h1>First Image</h1>
        </center>
      </div>

      <div class="item">
       <!-- <img src="chicago.jpg" alt="Chicago" style="width:100%;">-->
        <center>
           <h1>Second Image</h1>
        </center>
      </div>
    
      <div class="item">
        <!--<img src="ny.jpg" alt="New york" style="width:100%;">-->
        <center>
           <h1>Third Image</h1>
        </center>
      </div>
    </div>

    <!-- Left and right controls -->
    <a class="left carousel-control" href="#myCarousel" data-slide="prev">
      <span class="glyphicon glyphicon-chevron-left"></span>
      <span class="sr-only">Previous</span>
    </a>
    <a class="right carousel-control" href="#myCarousel" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right"></span>
      <span class="sr-only">Next</span>
    </a>
  </div>
</div>

</body>
</html>

只需将所需的图像放在我从代码中隐藏的锚标记中,您的滑动框就会出现。