gpt4 book ai didi

HTML 仅在大于最大高度时才显示滚动条

转载 作者:行者123 更新时间:2023-12-05 02:55:15 24 4
gpt4 key购买 nike

我只想在大于最大高度时才显示滚动条。但似乎滚动总是启用

<div style="text-align: left; font-size: 1.5rem; max-height: 7rem; overflow-y: auto;">
Some text
</div>

以我为例

enter image description here

最佳答案

使用 vh 而不是使用 rem 这意味着 font-size 而不是相对高度:

Unit-Reference

div {
text-align: left;
font-size: 1.5rem;
max-height: 10vh;
overflow-y: auto;
border: 1px solid red;
}
<div>
Some text Before Oracle9 if I had "select any table" privileges there was no problem doing so. ... allow direct access to the v$ tables, do not allow access by stored procedures ... I don't think O7_DICTIONARY_ACCESSIBILITY provides access to sys.link$
... Before Oracle9 if I had "select any table" privileges there was no problem doing so. ... allow direct access to the v$ tables, do not allow access by stored procedures ... I don't think O7_DICTIONARY_ACCESSIBILITY provides access to sys.link$ ...
https://jsfiddle.net/Manju06/3zshy8r0/34/ Before Oracle9 if I had "select any table" privileges there was no problem doing so. ... allow direct access to the v$ tables, do not allow access by stored procedures ... I don't think O7_DICTIONARY_ACCESSIBILITY
provides access to sys.link$ ...
</div>

关于HTML 仅在大于最大高度时才显示滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61368575/

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