Text only carousel

I cannot have a carousel with text without img . The text seems to interfere with the controls. In every example I found is used <img>. I tried to use class d-flex, block and even carousel-caption. Nothing is working yet.

<div id="carouselContent" class="carousel slide" data-ride="carousel">
    <div class="carousel-inner" role="listbox">
        <div class="carousel-item active">
            <p>lorem ipsum (imagine longer text)</p>
        </div>
        <div class="carousel-item">
            <p>lorem ipsum (imagine longer text)</p>
        </div>
    </div>
    <a class="carousel-control-prev" href="#carouselContent" 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="#carouselContent" role="button" data-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
</div>
+5
source share
2 answers

I think they carousel-controlsare intended for overlaying content, be it text or images. It would seem to text-centerbe a good option to center the text of each element.

, BS alpha 6, .carousel-item display:flex;, , carousel-item. : https://github.com/twbs/bootstrap/issues/21611

text-center display:block :

 <div class="carousel-item text-center p-4">
       <p>lorem ipsum (imagine longer text)</p>
 </div>

.carousel-item.active {
    display:block;
}

: http://www.codeply.com/go/OJHdvdXimm


: Bootstrap

+4

px-5 ( p). , , 20 . .

0

Source: https://habr.com/ru/post/1666226/


All Articles