0

我收到一个错误

值错误:字体大小解析错误)/(1600-300)))

来自以下每一行代码的https://jigsaw.w3.org/css-validator/validator。代码正在运行,CSSlint 没有报告错误,谷歌搜索也没有帮助。

谁能告诉我这里有什么问题?

h1.page-title { font-size:calc(30px + (30 - 6)*((100vw - 300px)/(1600-300)));font-weight: 400;letter-spacing: 0.015em !important  }
h2.entry-title { font-size:calc(28px + (28 - 6)*((100vw - 300px) / (1600 - 300))); font-weight: 400; letter-spacing: 0.015em !important  }
h3.entry-title { font-size: calc(24px + (24 - 6)*((100vw - 300px) / (1600 - 300))); font-weight: 400; letter-spacing: 0.015em !important  }
h4.entry-title { font-size: calc(20px + (20 - 6)*((100vw - 300px) / (1600 - 300))); font-weight: 400; letter-spacing: 0.015em  !important  }
h5.entry-title { font-size: calc(17px + (17 - 6)*((100vw - 300px) / (1600 - 300))); font-weight: 400; letter-spacing: 0.015em  !important  }
h1 { font-size:calc(28px + (28 - 6)*((100vw - 300px) / (1600 - 300))); font-weight: 400; letter-spacing: 0.015em !important  }
h2 { font-size: calc(24px + (24 - 6)*((100vw - 300px) / (1600 - 300))); font-weight: 400; letter-spacing: 0.015em !important  }
h3 { font-size: calc(20px + (20 - 6)*((100vw - 300px) / (1600 - 300))); font-weight: 400; letter-spacing: 0.015em  !important  }
h4 { font-size: calc(17px + (17 - 6)*((100vw - 300px) / (1600 - 300))); font-weight: 400; letter-spacing: 0.015em  !important  }
4

1 回答 1

1

w3 验证器参考CSS 规范

此外,+ 和 - 运算符的两边都需要空格。(可以使用 * 和 / 运算符,它们周围没有空格。)

(1600-300)因此,如果您想符合规范,您应该在 JkAlombro 提到的类似之前和之后添加空格。它在浏览器中仍然可以在没有空格的情况下工作,因为它们具有容错性并且实现了不太严格的解析器。

于 2019-07-29T04:53:49.890 回答