Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

style

概述

Returns the CSSStyleDeclaration interface for the declaration block of the CSSRule.

语法

styleObj = cssRule.style

例子

function stilo() {
  alert(document.styleSheets[0].cssRules[0].style.cssText);
}
// 弹出 "background-color: gray;"

备注

The declaration block is that part of the style rule that appears within the braces and that actually provides the style definitions (for the selector, the part that comes before the braces).

相关链接

规范

DOM Level 2 CSS: style

文档标签和贡献者

 此页面的贡献者: khalid32, ziyunfei
 最后编辑者: khalid32,