gpt4 book ai didi

html - 仅当有足够的垂直空间可用时,才将 div 固定在 *positioned fixed sidebar* 的底部

转载 作者:行者123 更新时间:2023-11-28 03:09:55 24 4
gpt4 key购买 nike

我有一个固定的侧边栏,只有在有足够的垂直空间可用时,我才想将一个 div 粘贴到它的底部。

如果没有足够的垂直空间,固定的 div 不应与前一个元素重叠,而应该顺流并生成一个滚动条。

有什么想法吗?

enter image description here enter image description here enter image description here

最佳答案

您应该查看引用侧边栏的 div,并在 CSS 中为其应用最小高度。

#sidebardiv{
min-height: XXXXpx; <--- Where the number of pixels is at least the
} combined height and margins of all 3 boxes.

关于html - 仅当有足够的垂直空间可用时,才将 div 固定在 *positioned fixed sidebar* 的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45765393/

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