gpt4 book ai didi

css - Bootstrap 列调整为较短的列

转载 作者:行者123 更新时间:2023-11-28 10:08:22 25 4
gpt4 key购买 nike

<分区>

使用 Bootstrap ,我有一行和两列。第一个包含图像,第二个包含一些文本。我试图在图像高度切断文本。如果没有 JavaScript 和固定高度,这可能吗?

感谢您的帮助!

.row {
margin: 1rem 0 0 1rem !important;
max-width: 20rem;
}
div>div {
border: 1px solid red;
}
.col-5 {
padding: 0 !important;
}
.col-7 {
overflow-y: hidden;
/* How do I make this column as tall as the previous? */
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-5">
<img src="https://booklers.net/images/userImages/Doidel/bookImages/4/thumb.jpg" class="img-fluid" />
</div>
<div class="col-7">
This is some test text. This is some more test text. This is some more test text. This is some more test text. This is some more test text. This is some more test text. This is some more test text. This is some more test text. This is some more test text. This is some more test text.
</div>
</div>

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com