StylePropertyMap

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

CSS 类型对象模型 APIStylePropertyMap 接口提供了 CSS 声明块的表示,该声明块可以替代 CSSStyleDeclaration

StylePropertyMapReadOnly StylePropertyMap

属性

从其父级 StylePropertyMapReadOnly 继承属性。

方法

从其父级 StylePropertyMapReadOnly 继承方法。

StylePropertyMap.append()

使用给定的属性和值向 StylePropertyMap 添加新的 CSS 声明。

StylePropertyMap.clear()

删除 StylePropertyMap 中的所有声明。

StylePropertyMap.delete()

使用给定属性删除 CSS 声明。

StylePropertyMap.set()

使用给定属性更改 CSS 声明。

规范

Specification
CSS Typed OM Level 1
# the-stylepropertymap

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
StylePropertyMap
append
clear
delete
set

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.