gpt4 book ai didi

"screen height - (header + footer height)"的 CSS 表达式

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

我有一个包含 <header> 的 HTML 页面, <section><footer> .我想将 section min-height 设置为 screen height - (header + footer height) .这可能吗?

section{
min-height: screen-height-(header + footer height)
}

最佳答案

使用预处理器。 SASS/LESS/手写笔。

LESS 示例:

@base: 5%;
@filler: @base * 2;
@other: @base + @filler;

color: #888 / 4;
background-color: @base-color + #111;
height: 100% / 2 + @filler;

LESS Docs link

但是,如果您想根据屏幕高度进行操作,预处理器无法检测屏幕高度,您将不得不为此使用 JavaScript/jQuery。

关于 "screen height - (header + footer height)"的 CSS 表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27646444/

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