English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
L'attributo text determina il colore del testo del documento HTML.
Specificare il colore del testo del documento HTML come rosso:
<!DOCTYPE html> <html> <head> <title>HTML:<body> text attributo - sito di lezioni basici oldtoolbag.com</title> <body text="red"> <h1>Hello world!</h1> <p>This is some text.</p> </body> </html>Testa e vedi <‹/›>
IEFirefoxOperaChromeSafari
Tutti i browser mainstream supportano l'attributo text.
HTML5 non supporta più l'attributo text di <body>. Utilizzare CSS al suo posto.
L'attributo text di <body> è stato abbandonato in HTML 4.01. in HTML 4.01.
L'attributo text determina il colore del testo del documento HTML.
In HTML 4.01, l'uso dell'attributo text del corpo non è raccomandato; nel DTD Strict di XHTML 1.0, l'attributo text del corpo non è supportato. Usa CSS invece.
Sintassi CSS (<sezione head>): <style>body{color:green}</style>
Esempio CSS: Imposta il colore del testo nel documento
Nella nostra guida CSS, puoi trovare ulteriori informazioni su Proprietà del colore del testo Conoscenza.
<body text="color_name|hex_number|rgb_number">
Valore | Descrizione |
---|---|
color_name | Stabilisce il colore del testo come nome del colore (ad esempio "red"). |
hex_number | Stabilisce il colore del testo come valore esadecimale (ad esempio "#ff0000"). |
rgb_number | Stabilisce il colore del testo come codice rgb (ad esempio "rgb(255,0,0)"). |