大网数据广告活动
Web 标准与前端开发

HTMLStyleElement

· 52CE 我爱测

`HTMLStyleElement`** 接口表示 style 元素。它从 HTMLElement 和 LinkStyle 中继承属性和方法。

HTML DOM

HTMLStyleElement 接口表示 style 元素。它从 HTMLElement 和 LinkStyle 中继承属性和方法。

这个接口不允许修改包含其中的 CSS(大多数情况下)。如果需要修改 CSS,前往关于使用动态样式的信息查看在 DOM 中用于修改特定 CSS 属性的对象。

属性

Inherits properties from its parent, HTMLElement**, and implements LinkStyle**.

  • HTMLStyleElement.media
    • : Is a String representing the intended destination medium for style information.
  • HTMLStyleElement.type
    • : Is a String representing the type of style being applied by this statement.
  • HTMLStyleElement.disabled
    • : Is a Boolean value representing whether or not the stylesheet is disabled (true) or not (false).
  • LinkStyle.sheet
    • : Returns the StyleSheet object associated with the given element, or null if there is none
  • HTMLStyleElement.scoped
    • : Is a Boolean value indicating if the element applies to the whole document (false) or only to the parent's sub-tree (true).

方法

No specific method; inherits properties from its parent, HTMLElement**, and LinkStyle**.

规范

浏览器兼容性

参见

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。