English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
style globale Eigenschaft Enthält CSS-Style-Deklarationen, die auf das Element angewendet werden. Zu beachten ist, dass Stile am besten in separaten Dateien definiert werden sollten. Der Hauptzweck dieses Attributes sowie des <style>-Elements ist die schnelle Dekoration. Zum Beispiel für Testzwecke.
Verwendungshinweise:Dieses Attribut kann nicht zur Übermittlung von semantischen Informationen verwendet werden. Selbst wenn alle Stile entfernt werden, sollte die Seite die korrekte Semantik beibehalten. Normalerweise wird es nicht zur Verbergence von irrelevanten Informationen verwendet; dies sollte mit dem hidden-Attribut erreicht werden.
Verwendung des style-Attributs in HTML-Dokumenten:
<!doctype html> <html> <kopf> <meta charset="UTF-8"> <titel>Verwendung von HTML-Style-Attributen (Grundtutorialsite oldtoolbag.com)</titel> </kopf> <body> <h1 style="color:blue;text-ausrichten:center">Dies ist eine Überschrift</h1> <p style="color:green">Dies ist ein Absatz.</p> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the style attribute
The style attribute specifies the inline style of an element.
The style attribute overrides any globally set styles, such as styles specified in the <style> tag or in an external stylesheet.
In HTML5In, you can use the style attribute on any HTML element (it will be validated on any HTML element. However, it may not be useful).
In HTML 4.01In, you cannot use the style attribute with <base>, <head>, <html>, <meta>, <param>, <script>, <style> and <title> together
<element style="style_definitions">
Value | Description |
---|---|
style_definitions | One or more CSS properties and values separated by semicolons. (For example: style="color:blue;text-align:center) |