作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<分区>
使用 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>
我是一名优秀的程序员,十分优秀!