2017-09-18 20 views
0

2つの列を同じ高さにしようとしていますが、最初の列のコンテンツを水平方向と垂直方向に整列しようとしています。同じ高さの列+ブートストラップ4の垂直と水平の中心のコンテンツ

これは私が何をしようとしているまとめ:

<div class="row"> 
<div class="col-lg-4 align-self-center"> 
    <p>Text here should be centered both horizontally and vertically. But this col should have the same height as the col containing the image.</p> 
</div> 
<div class="col-lg-8"> 
    <img class="img-fluid" src="http://via.placeholder.com/1920x1080"> 
</div> 

ます。また、ここで見ることができ:https://www.codeply.com/go/bGhFGn8nqq

「私は複数のものを試してみたが、私はすることができますそれは正しいと思われる。

ありがとうございます。

答えて

0

センターコラム内のコンテンツp ...

https://www.codeply.com/go/lyPAOH1Tq2

<div class="row"> 
    <div class="col-lg-4 d-flex"> 
     <p class="my-auto">Text here should be centered both horizontally and vertically. But this col should have the same height as the col containing the image.</p> 
    </div> 
    <div class="col-lg-8"> 
     <img class="img-fluid" src="http://via.placeholder.com/1920x1080"> 
    </div> 
</div> 
関連する問題