Css 线路高度计算vh装置
我有一点复杂的问题。我需要通过CSS中的Css 线路高度计算vh装置,css,viewport-units,css-calc,Css,Viewport Units,Css Calc,我有一点复杂的问题。我需要通过CSS中的vh单位和px的差值来设置line height。我的想法是用这个代码来设置它 line-height: calc(100vh - 100px); 这听起来很容易,但不起作用。为什么使用这些单位的calc不起作用,请参见中的“where is is solution forheightproperty by hacking margin and padding,但它不能用于line height property” 我看到这个问题在Chrome、IE和E
vh
单位和px
的差值来设置line height
。我的想法是用这个代码来设置它
line-height: calc(100vh - 100px);
这听起来很容易,但不起作用。为什么使用这些单位的calc不起作用,请参见中的“where is is solution forheight
property by hacking margin and padding,但它不能用于line height property”
我看到这个问题在Chrome、IE和Edge中得到了解决,但我也需要在Firefox上这样做。在Firefox中,它显示在开发者工具中
无效的属性值
有什么想法吗?(JavaScript不是我的解决方案)你能描述一下它在Chrome、IE和Edge中是如何工作的吗?