gpt4 book ai didi

html - Div 在另一个 div 内溢出

转载 作者:太空宇宙 更新时间:2023-11-04 15:21:57 26 4
gpt4 key购买 nike

我有这个:

<div class="one">
<h2>Title that can be quite long and I don't know it's height</h2>
<div class="two">Content that can overflow and that needs to be scrolled (but the title needs to remain up so that won't scroll</div>
</div>

还有这个 CSS:

.one{height: 250px; width: 120px;}
.two{overflow:auto;}

但我无法让 .two 进行滚动。我不知道 .two 或 h2 的高度。此外,我只希望 .two 进行滚动。

最佳答案

我制作了 http://jsfiddle.net/zm8Lj/为你。请看一下。

关于html - Div 在另一个 div 内溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7926367/

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