Center content vertically in Bootstrap3 carousel with flexbox

后端 未结 1 1893
温柔的废话
温柔的废话 2021-01-14 20:55

I am trying to center h3 and p elements inside a div, Bootstrap\'s .carousel-caption to be more exact. I have given .carousel-caption fixed height and width. I am trying to

相关标签:
1条回答
  • 2021-01-14 21:15

    Got a tip to check this http://philipwalton.github.io/solved-by-flexbox/demos/vertical-centering/ and it turned out that the solution was actually embarrassingly simple http://jsfiddle.net/pYjnF/1/

    <div class="carousel-caption flex" style="display: flex; align-items: center;">
       <div> <!-- div which content is not aligned -->
          <h3>Headline lorem ipsum dolor</h3>
          <p>Story gnis dis dolor re niet, sed quia se perferciaes eossedit, susam, sam voluptas sandebi stiusam, cuptaturem sequis imi, is etur</p>
       </div>
    </div>    
    
    0 讨论(0)
提交回复
热议问题