2015-09-06 74 views
-2

我有這個問題的年齡,有時我只是放棄,但現在我決定不......我不能將圖像應用到Bootstrap旋轉木馬,這是我應該工作的CSS代碼:引導傳送帶圖像不適用

background-image: url("../img/header.jpg"); 

我做了一個YouTube的教程和我做,她在做有具體的方式:https://www.youtube.com/watch?v=DKWyr35srS4

是的,我記得紀念jQuery和引導JS-文件。 我不知道,我也有與非Bootstrap項目相同的圖像問題。我應該將圖像文件路徑放到html和css中嗎?

+0

你能告訴更多的代碼嗎? HTML很重要。控制檯中是否有錯誤?路徑是否正確?做背景圖像的工作?請提供更多信息 – DasSaffe

+0

我試圖展示更多的代碼,但我是新來的,並且這不顯示原始的html代碼...我不知道爲什麼這不顯示它... –

+0

檢查你的格式和空格是否正確 – DasSaffe

回答

0

Click here for Fiddle

<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.min.js"></script> 
 
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css" rel="stylesheet"/> 
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> 
 
    <!-- Indicators --> 
 
    <ol class="carousel-indicators"> 
 
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> 
 
    <li data-target="#carousel-example-generic" data-slide-to="1"></li> 
 
    <li data-target="#carousel-example-generic" data-slide-to="2"></li> 
 
    </ol> 
 

 
    <!-- Wrapper for slides --> 
 
    <div class="carousel-inner" role="listbox"> 
 
    <div class="item active"> 
 
     <img src="..." alt="..."> 
 
     <div class="carousel-caption"> 
 
     ... 
 
     </div> 
 
    </div> 
 
    <div class="item"> 
 
     <img src="..." alt="..."> 
 
     <div class="carousel-caption"> 
 
     ... 
 
     </div> 
 
    </div> 
 
    ... 
 
    </div> 
 

 
    <!-- Controls --> 
 
    <a class="left carousel-control" href="#carousel-example-generic" 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="#carousel-example-generic" role="button" data-slide="next"> 
 
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> 
 
    <span class="sr-only">Next</span> 
 
    </a> 
 
</div>

直接跟隨引導頁:Carousel

+0

如果你發現答案有用,請標記爲最佳答案 –

+0

是的,謝謝你的幫助! –