2017-05-29 63 views
0

我想在Bootstrap 4中創建一個見證滑塊,這將在WordPress中使用自定義帖子類型,但我努力讓滑塊工作。引導4滑塊文本只見證

所以我對你的問題是,我怎麼才能在旋轉木馬上的文字?當我註釋掉圖像時,它不起作用,並且已經在網上搜索瞭如何做到這一點,但是BS4沒有太多采用,令人沮喪!

<div class="testimonial-Slider"> 
    <div class="container"> 
     <div class="row"> 

<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> 
    <ol class="carousel-indicators"> 
    <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> 
    <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> 
    <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> 
    </ol> 
    <div class="carousel-inner" role="listbox"> 
    <div class="carousel-item active"> 
     <img class="d-block img-fluid" src="http://lorempixel.com/960/300/" alt="First slide"> 

    <div class="carousel-caption"> 
     <h3>Test Headings</h3> 
     <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the indu</p> 
    </div> 
    </div> 

    <div class="carousel-item"> 
     <img class="d-block img-fluid" src="http://lorempixel.com/960/300/" alt="Second slide"> 
     <div class="carousel-caption"> 
     <h3>Test Headings</h3> 
     <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the indu</p> 
     </div> 
    </div> 
    <div class="carousel-item"> 
     <img class="d-block img-fluid" src="http://lorempixel.com/960/300/" alt="Third slide"> 
     <div class="carousel-caption"> 
     <h3>Test Headings</h3> 
     <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the indu</p> 
     </div> 
    </div> 
    </div> 
    <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> 
    <span class="carousel-control-prev-icon" aria-hidden="true"></span> 
    <span class="sr-only">Previous</span> 
    </a> 
    <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> 
    <span class="carousel-control-next-icon" aria-hidden="true"></span> 
    <span class="sr-only">Next</span> 
    </a> 
</div> 
</div> 
</div> 
</div> 

我相當有信心我可以得到自定義帖子類型和WP查詢工作正常,但這是我有問題!

乾杯人:)

回答

1

.carousel-caption使用position:absolute所以它裏面的父它不佔用空間。它填補了空間的形象,給予了高度。使用position: relative。檢查應用於.carousel-caption的所有屬性,它們可能會導致您想要的其他問題。

或者只是在.carousel-item之內創建一個新類,如.carousel-caption-custom,並且只使用您需要的css。

+0

感謝您的支持,它幫助我解決了問題,現在又解決了,再次歡呼! – user3502952