问题的问题是由减法运算符周围空间不足引起的。
Note that the grammar requires spaces around binary ‘+’ and ‘-’
operators. The ‘*’ and ‘/’ operators do not require spaces.
我推测这是为了澄清运算符和有符号数字之间的区别。
差:calc(100%-88px)
良好:calc(100% – 88像素)
How do I know it is not recognizing it? Because of the strikethrough
and the yellow triangle icon next to the style rule in chrome dev
tools.
在Chrome的开发人员工具中查看的属性可能有效,但会被覆盖;然而,一个属性被打破,并且旁边有一个警告三角形图标是无效的。
其他注意事项
> Chrome已支持calc()为quite some time(在OSX和Windows上确认)。
> Chrome may not support viewport units如calc()中的vh / vw。截至2014年底,有实施这项活动,但the related bug仍然开放。>在我的测试中,Safari将在OSX而不是Windows上支持带-webkit供应商前缀的calc()。> IE9支持没有供应商前缀的calc()。> FF支持没有供应商前缀的calc()。