Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. Web API
  3. HTMLStyleElement

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

HTMLStyleElement

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.

* Some parts of this feature may have varying levels of support.

HTMLStyleElement 接口表示<style> 元素。它从HTMLElementLinkStyle 中继承属性和方法。

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

must be a string

属性

Inherits properties from its parent,HTMLElement, and implementsLinkStyle.

HTMLStyleElement.media

Is aDOMString representing the intended destination medium for style information.

HTMLStyleElement.type

Is aDOMString representing the type of style being applied by this statement.

HTMLStyleElement.disabled

Is aBoolean value representing whether or not the stylesheet is disabled (true) or not (false).

LinkStyle.sheet只读

Returns theStyleSheet object associated with the given element, ornull if there is none

HTMLStyleElement.scoped非标准已弃用

Is aBoolean 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, andLinkStyle.

规范

Specification
HTML
# htmlstyleelement

浏览器兼容性

参见

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp