Gets or sets the textual representation of a CSS style declaration.
Property of css/cssom/CSSStyleDeclaration/CSSStyleDeclarationcss/cssom/CSSStyleDeclaration/CSSStyleDeclaration
Syntaxvar declarationText = declaration.cssText;
declaration.cssText = declarationText;
Return Value
Returns an object of type StringString
The textual representation of the CSS style declaration.
Examples<style>
body { background-color: darkblue; }
</style>
<script>
var stylesheet = document.styleSheets[0];
alert(stylesheet.cssRules[0].cssText);
// returns "body { background-color: darkblue; }"
</script>
Notes
This property reflects the current state of the declaration and not its initial value.
Related specificationsRetroSearch 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