【问题标题】:Bootstrap Carousel inside a screen image屏幕图像内的引导轮播
【发布时间】:2017-07-03 05:18:03
【问题描述】:

我想在 PC 屏幕图像中放置一个 Bootstrap Carousel 滑块,因此我想将它完美地放入该屏幕并具有响应性。

我不知道哪个是最好的方法,但我尝试在 css 中将屏幕图像制作为滑块的背景图像,但它不起作用。谁能帮我?还是有更好的主意?

例如: (这个例子有很多画面,但是是我想要达到的精神)

轮播代码:

<!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">
  <link rel="stylesheet" href="main.css">

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.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">
  <br>
  <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>
      <li data-target="#myCarousel" data-slide-to="3"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner screen" role="listbox">

      <div class="item active">
        <img src="http://placehold.it/712x400">
      </div>

      <div class="item">
        <img src="http://placehold.it/712x400">
      </div>
    
      <div class="item">
        <img src="http://placehold.it/712x400" >
      </div>
  
      </div>
 
    </div>

  </div>

</body>
</html>

【问题讨论】:

    标签: html css twitter-bootstrap carousel gallery


    【解决方案1】:

    我遇到了同样的问题,但终于找到了解决方案!

    你可以试试这个模型:HTML5 DEVICE MOCKUPS

    <div class="device-mockup" data-device="iphone5" data-orientation="portrait" data-color="black">
                <div class="device">
                    <div class="screen">
                        <!-- PUT CONTENTS HERE -->
                        You can put your slider here. The images will be automatically responsive with the device. 
                    </div>
                    <div class="button">
                        <!-- You can hook the "home button" to some JavaScript events or just remove it -->
                    </div>
                </div>
            </div>
    

    只需阅读他们 github 上的文档及其解释。希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-09-14
      • 1970-01-01
      • 1970-01-01
      • 2018-08-08
      • 2017-04-08
      • 2019-06-21
      • 2016-05-15
      相关资源
      最近更新 更多