Esempio
Specificare il colore del testo in un documento HTML:
<html>
<body text="green">
<h1>Hello world!</h1>
<p><a href="http://www.w3ii.com">Visit w3ii.com!</a></p>
</body>
</html>
Prova tu stesso " Definizione e utilizzo
Il text attributo specifica il colore del testo in un documento.
Supporto per il browser
Attributo | |||||
---|---|---|---|---|---|
text | sì | sì | sì | sì | sì |
Note di compatibilità
Il <body> attributo di testo non è supportato in HTML5. Utilizzare invece CSS.
Sintassi CSS (in <head> ): <style>body{color:green}</style>
CSS Esempio: impostare il colore del testo in un documento
Nel nostro tutorial CSS è possibile trovare ulteriori dettagli sul text proprietà di colore .
Sintassi
<body text="color_name|hex_number|rgb_number">
I valori degli attributi
Valore | Descrizione |
---|---|
color_name | Specifica il testo-colore con un nome di colore (come il "red" ) |
hex_number | Specifica il testo colori con un codice esadecimale (come "#ff0000" ) |
rgb_number | Specifica il testo-colore con un codice RGB (come "rgb(255,0,0)" ) |