在Firefox,Opera和IE浏览器,我可以通过让他们:如何获得WebKit中所有支持的CSS属性?
>> for (k in document.body.style) console.log(k) -> opacity background height textAlign . ... long list ... . pointerEvents
在WebKit的结果是完全不同的:
>> for (k in document.body.style) console.log(k) -> cssText length parentRule getPropertyValue getPropertyCSSValue removeProperty getPropertyPriority setProperty item getPropertyShorthand isPropertyImplicit
更新:最新WebKit does enumerate over CSS properties in HTMLElement.style相同方式,所有过浏览器呢。
迭代'document.body.style'提供了Javascript样式属性。 'document.defaultView.getComputedStyle(document.body,'')'只有CSS属性。例如'backgroundAttachment'与'background-attachment'。 – 2012-01-06 10:43:25
以任何方式获得所有可能的值提示,如'继承',百分比,文本底部;为他们每个人。即使使用js。 – 2013-07-07 02:33:15