Name
cssText — NN n/a IE 4 DOM n/a
Synopsis
Read-only
Returns a string of the entire CSS style sheet rule applied to the
element. If the rule included shorthand style attribute settings
(such as border
), the components for each of the
four sides are spelled out (although not down to the most granular
specifications). For example, if you set the STYLE
attribute of an element to STYLE="border:
groove
red
3px"
, the cssText
property for
that element returns:
BORDER-TOP: 3px groove red; BORDER-RIGHT: 3px groove red; BORDER-BOTTOM: 3px groove red; BORDER-LEFT: 3px groove red
You can assign a shorthand value to the property, however.
Example
document.all.block3.style.cssText = "margin: 2px; font-size: 14pt"
Value
String value of semicolon-delimited style attributes.
Default
None.
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.