The style property returns a CSSStyleDeclaration object, which represents an element's style attribute. 77
73
4
34
The style property returns the inline styles of an element.
22
235
4
document.getElementById("myH1").style.color = "red";
Often, styles will be applied to elements via a stylesheet as we have done previously in this article, but sometimes we have to add or edit an inline style directly. The exception is arbitrary XML elements, including MathML in Firefox ( Safari not tested ).
Stile in der Style-Eigenschaft haben das Format von durch Trennzeichen getrennten Name-Wert-Paaren, wobei jedes Paar durch ein Semikolon getrennt ist, wie im folgenden dargestellt: Styles in the Style property take the form of colon-delimited name-value pairs, with each pair separated by a …
Summary
Style Object Properties .
document.getElementById("myH1").style.color = "red";
25
Ruft eine durch Semikola getrennte Liste der Formate für das aktuelle Element ab oder legt diese fest.Gets or sets a semicolon-delimited list of styles for the current element.Eine Zeichenfolge, die aus allen Formaten des Elements besteht.Der HTML-Dokumentobjektmodell (DOM) verwendet Stile, die in der World Wide Web-Cascading Stylesheets Spezifikation definiert sind, um die Anzeige eines Elements zu steuern.The HTML Document Object Model (DOM) uses styles as defined in the World Wide Web Consortiums Cascading Style Sheets specification to control the display of an element.Eine vollständige Liste aller verfügbaren Stile im HTML-DOM finden Sie unter For a full list of all available styles in the HTML DOM, see
7
The style property returns a CSSStyleDeclaration object, which represents an
45
10
114
38
Styles in the Style property take the form of colon-delimited name-value pairs, with each pair separated by a semicolon, as follows:
10
75
18
Lors de l'obtention, il renvoie un objet CSSStyleDeclaration qui contient une liste de toutes les propriétés de styles pour cet élément avec des valeurs affectées aux attributs définis dans l' attribut de style ligne de l'élément.
The "CSS" column indicates in which CSS version the property is defined (CSS1, CSS2, or CSS3). The Style object represents an individual style statement.The "CSS" column indicates in which CSS version the property is defined (CSS1, CSS2, or CSS3).The Style object can be accessed from the head section of the document, or from specific HTML element(s).Accessing style object(s) from the head section of the document:You can create a