Baseline Widely available
The CSSStyleDeclaration.getPropertyPriority() method interface returns a string that provides all explicitly set priorities on the CSS property.
SyntaxgetPropertyPriority(property)
Parameters
property
A string representing the property name to be checked.
A string that represents the priority (e.g., "important"
) if one exists. If none exists, returns the empty string.
The following JavaScript code checks whether margin
is marked as important in a CSS selector rule:
const declaration = document.styleSheets[0].cssRules[0].style;
const isImportant = declaration.getPropertyPriority("margin") === "important";
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4