English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The text attribute specifies the text color of the HTML document.
Legen Sie die Farbe des Textes in einem HTML-Dokument auf rot fest:
<!DOCTYPE html> <html> <head> <title>HTML:<body> text Attribut - Grundlegende Tutorials-Website oldtoolbag.com</title> <body text="red"> <h1>Hello world!</h1> <p>This is some text.</p> </body> </html>Testen Sie es heraus ‹/›
IEFirefoxOperaChromeSafari
Alle gängigen Browser unterstützen das text-Attribut.
HTML5 wird nicht mehr unterstützt. Verwenden Sie stattdessen CSS.
Der text-Attribut von <body> im HTML 4.01is deprecated. in HTML 4.01.
The text attribute specifies the text color of the HTML document.
In HTML 4.01 It is not recommended to use the text attribute of the body element; in XHTML 1In .0 Strict DTD, the text attribute of the body element is not supported. Please use CSS instead.
CSS Syntax (<head> section): <style>body{color:green}<//style>
CSS Example: Set Text Color in Document
In our CSS tutorial, you can find more about Text Color Attribute Knowledge.
<body text="color_name|hex_number|rgb_number">
Value | Description |
---|---|
color_name | Define the font color with color name (for example "red")。 |
hex_number | Define the font color with hexadecimal value (for example "#ff0000")。 |
rgb_number | Define the font color with rgb code (for example "rgb(255,0,0)")。 |