【发布时间】:2014-03-15 14:40:59
【问题描述】:
According to w3schools,outline 的语法是:outline: <color> <style> <width>;,这三个都可以省略。
而inherit 的值是三个的有效值,或者单个outline: inherit 意味着它应该继承所有三个。
我问这个是因为我正在为 CSS 缩小器开发属性优化器。根据上面的链接,outline: inherit none 3px相当于outline: inherit 3px,outline: invert inherit 3px也相当于outline: inherit 3px,
但结果似乎太模棱两可了。
所以问题是,浏览器如何解释outline: inherit 0px?他们是否将inherit 分配给颜色或样式?
【问题讨论】:
-
请不要将“根据 W3C”链接到 w3schools.com ever - 因为:w3fools.com。至于问题本身:你自己在不同浏览器中测试的结果是什么?
-
@CBroe 我完全同意你的看法,特别是因为你可以看到人们开始混淆万维网联盟 (W3C) 和这个第三方网站。
-
别在意 W3C 和 W3Schools 之间的混淆 - W3Schools 甚至在哪里说“
inherit的值是三个的有效值”? -
抱歉,我的印象是 w3schools 与 W3C 有某种关联。
标签: css web-standards css-parsing