2017-02-14 15 views
3

PC画面内にブートストラップカルーセルスライダを配置したいので、その画面内に完全にフィットさせたいと思います。ブートストラップ画面イメージ内のカルーセル

私は一番良い方法は分かりませんが、私はCSSのスライダの背景イメージのような画面イメージを作ろうとしましたが、うまくいきません。誰でも助けてくれますか?またはより良いアイデアを持っている?例えば

screen (あり、この例の多くの画面がありますが、私は達成するために何をしたいの精神である)

カルーセルコード:

<!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>

答えて

2

私は同じ問題を抱えていたが、最終的に解決策を見つけた!

あなたはこのモックアップを試すことができます。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の上でその説明をお読みください。お役に立てれば!

関連する問題