2016-06-23 60 views
0
<div class="container"> 
    <div id="myCarousel" class="Carousel slide" data-ride="Carousel" data-interval="1000"> 
     <ol class="Carousel-indicators"> 
      <li data-target="#myCarousel" data-slide-to="0" class="active"></li> 
      <li data-target="#myCarousel" data-slide-to="1"></li> 
     </ol> 

     <div class="Carousel-inner"> 
      <div class="item active" alt="Slide 1"> 
       <img class="img-responsive center-block" src="img/water.jpg" alt="Slide 2"> 
       <div class="Carousel-caption"> 
        <h1>Theme1</h1> 
       </div> 
      </div> 
      <div class="item "> 
       <img class="img-responsive center-block" src="img/ice.jpg"> 
       <div class="Carousel-caption"> 
        <h1>Theme2</h1> 
       </div> 
      </div> 
     </div> 

     <a class="left Carousel-control" href="#myCarousel" role="button" data-slide="prev"> 
      <span class="glyphicon glyphicon-chevron-left"></span> 
     </a> 

     <a class="right Carousel-control" href="#myCarousel" role="button" data-slide="next"> 
      <span class="glyphicon glyphicon-chevron-right"></span> 
     </a> 
    </div> 

enter image description here 我的照片不會互相重疊爲什麼,但我的代碼是正確的,我使用的自舉的例子,但什麼是我不知道該圖像以某種方式在每個不來的原因其他轉盤引導圖像相互不重疊的

+0

請建立一個小提琴 –

回答

0

嗨,是你的類becz檢查你的類名

class="carousel-inner" 

但你提到

class="Carousel-inner" 

我現在改變了這裏就OK

<!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="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> 
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 
    <style> 
    .carousel-inner > .item > img, 
    .carousel-inner > .item > a > img { 
     width: 70%; 
     margin: auto; 
    } 
    </style> 
</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"> 


    <div class="item active" alt="Slide 1"> 
    <img class="img-responsive center-block" src="img_chania.jpg" alt="Slide 2"> 
    <div class="Carousel-caption"> 
    <h1>Theme1</h1> 
    </div> 
    </div> 
    <div class="item "> 
    <img class="img-responsive center-block" src="img_chania2.jpg"> 
      <div class="Carousel-caption"> 
    <h1>Theme2</h1> 
    </div> 
    </div> 
    </div> 

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

    </div> 
</div> 

</body> 
</html>