4

其對我來說很難explaint我想要的東西,所以我做了mocup enter image description here引導4和多個元素

如何使與引導4的高度?因此,目標是右邊的4個元素始終(除了移動設備上)等於左邊元素(圖像)的高度。有人可以幫助嗎?現在是makrup。

<!DOCTYPE html> 
 
<html lang="en"> 
 

 
<head> 
 
    <meta charset="UTF-8"> 
 
    <title>Document</title> 
 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> 
 
</head> 
 

 
<body> 
 

 
    <div class="container"> 
 
    <section class="hero"> 
 
     <div class="row"> 
 
     <div class="col col-md-8"><img src="http://placehold.it/700x300/ccc/333.png?text=placeholder" alt=""></div> 
 
     <div class="col col-md-4"> 
 
      <div class="contentMy">somthing</div> 
 
      <div class="contentMy">somthing</div> 
 
      <div class="contentMy">somthing</div> 
 
      <div class="contentMy">somthing</div> 
 
     </div> 
 
     </div> 
 
    </section> 
 
    </div> 
 
    <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script> 
 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script> 
 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script> 
 
</body> 
 

 
</html>

回答

3

您可以使用引導4的新Flexbox的實用程序類。該d-flex類用於display:flex,然後flex-column用於設置flex-direction: column ..

<div class="container"> 
    <section class="hero"> 
     <div class="row"> 
      <div class="col col-md-8"><img src="" alt=""></div> 
      <div class="col col-md-4 d-flex flex-column"> 
       <div class="contentMy h-100">somthing</div> 
       <div class="contentMy h-100">somthing</div> 
       <div class="contentMy h-100">somthing</div> 
       <div class="contentMy h-100">somthing</div> 
      </div> 
     </div> 
    </section> 
</div> 

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

+0

TY這麼多。我試圖找出所有新的bootstrap,但我沒有弄清楚:) – NoobyAFK