当不同的孩子变小时,CSS如何使孩子变大
我得到了一些卡片,这些卡应该显示一个网站的预告片,并从该网站上获取标题和摘录。底部灰色背景是display:Flex
的父级。我将容器设置为高度:200px
,并且子元素应适合内部。
因为标题和文本的网站之间的不同,所以我希望仅在一个CSS课程中尽可能地适合它们。
因此,当标题短并且只占用一行时,我想在摘录字段中添加一行。
有什么办法可以通过CSS实现这一目标? 可以显示:Flex
处理此操作?我尝试使用flex-grow
,但它不起作用
”>
I got some cards that should show a trailer of a website taking the title and a excerpt from that given website. The bottom grey background is a parent div with display: flex
on it. I've set the container to height: 200px
and the child elements should fit inside.
Because the title and text can vary from site to site i would like to make them fit as best as possible with just one CSS class.
So, when a title is shorter and only takes up one line, I would like to add one line to the excerpt field.
Is there any way to make that happen with CSS? can display: flex
handle this? I've tried to use flex-grow
but it doesn't work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论