What are min / max units of vh?

How, what are the limitations of the browser? If I have 99999999999999vh, will it be 99999999999999vh or will it be something strange like 2145629vh?

+6
source share
1 answer

From the viewport height (vh) specification , it does not mention that there is a minimum / maximum limit. However, in Section 5 of CSS Values ​​and Units: Numerical Data Types , he mentions that:

CSS theoretically supports infinite precision and infinite ranges for all types of values; however, in reality, implementations have limited capacity. UAs must support reasonably useful ranges and prefixes.

and some SO users check the value limit for each browser , and the results are as follows:

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

and the behavior described above is explained in Section 5: Distance Units :

Although some properties allow negative lengths, this can complicate formatting, and there may be implementation restrictions. If a negative length value is allowed but not supported, it should be converted to the closest value that can be supported.

Hope the above can answer your question.

+9
source

All Articles