gpt4 book ai didi

css - vh 单位的最小值/最大值是多少?

转载 作者:技术小花猫 更新时间:2023-10-29 11:18:08 26 4
gpt4 key购买 nike

例如,浏览器有哪些限制?如果我有 99999999999999 vh,它实际上是 99999999999999 vh 还是像 2145629vh 这样奇怪的东西?

最佳答案

从视口(viewport)高度(vh)specification ,它没有提到最小/最大值的限制。然而,在 Section 5 of CSS Values and Units: Numeric Data Types ,它提到:

CSS theoretically supports infinite precision and infinite ranges for all value types; however in reality implementations have finite capacity. UAs should support reasonably useful ranges and precisions.

还有一些SO users do test the limit of values of each browsers ,结果如下:

Firefox: 33554400px
Chrome: 33554428px
Opera: 33554428px
IE 9: 21474836.47px

上述行为在 Section 5: Distance Units 中有解释。 :

While some properties allow negative length values, this may complicate the formatting and there may be implementation-specific limits. If a negative length value is allowed but cannot be supported, it must be converted to the nearest value that can be supported.

希望以上能回答你的问题。

关于css - vh 单位的最小值/最大值是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34757364/

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