How can i adjust the img height in one column to the height of the height in another column [duplicate]

我与影子孤独终老i 提交于 2020-06-09 05:29:46

问题


In a 2 flex bootstrap columns, I would like to adjust the height of the image on the right column to the height of the text in the left columns. How could I achieve this ?

img {
  max-width: 100%;
  width: 100%;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />

<div class="container-fluid">
  <div class="row">
    <div class="col-6">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor
      sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur
      adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    </div>
    <div class="col-6">
      <img src="https://via.placeholder.com/150" alt="">
    </div>
  </div>
</div>

Thanks for the help :)

来源:https://stackoverflow.com/questions/62039556/how-can-i-adjust-the-img-height-in-one-column-to-the-height-of-the-height-in-ano

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!