gpt4 book ai didi

html - 如何删除继承父高度的 flex 元素

转载 作者:太空宇宙 更新时间:2023-11-04 16:00:09 25 4
gpt4 key购买 nike

<分区>

我有以下布局:

.content-container {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}

.view-content {
width: 100%;
display: flex;
justify-content: space-around;
}

.zavod,
.ekipa {
width: 100%;
max-width: 300px;
background-color: red;
}
<div class="content-container">
<div class="view-content">
<section class="zavod">
<p>Some text</p>
</section>
<section class="ekipa">
<p>Some more text</p>
<p>Even more text</p>
<p>Even more text</p>
</section>
</div>
</div>

我想要完成的是让.zavod.ekipa 有不同的高度。现在它可以在单个 flex 容器中工作,但是当我嵌套多个容器时它就不起作用了。

我做错了什么?

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