gpt4 book ai didi

html - 在 2 个固定 div(顶部和底部)之间制作滚动文本内容

转载 作者:太空宇宙 更新时间:2023-11-04 10:52:32 24 4
gpt4 key购买 nike

https://jsfiddle.net/4n496n23/1/

顶部 block 包含图像,所以我们真的不知道它的高度。

HTML

<div id="top-block">

</div>
<div id="text-block">
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
</div>
<div id="bottom-block">

</div>

最佳答案

你可以使用 flex:

html,
body {
height: 100%;
margin: 0;
}
body {
display: flex;
flex-flow: column;
}
#top-block {
background-color: #569688
}
#text-block {
font-size: 2em;
overflow: auto;
flex: 1;
}
#bottom-block {
background-color: #b9e111
}
<div id="top-block">
The Extremes
<br/>of Good
</div>
<div id="text-block">
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up
one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum
et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section
1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English
versions from the 1914 translation by H. Rackham.
</div>
<div id="bottom-block">
Finibus Bonorum
</div>

关于html - 在 2 个固定 div(顶部和底部)之间制作滚动文本内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34899248/

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