Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML body text attribute

HTML text attribute

HTML body Tag Reference HTML Tag

Example

Set the text color in the HTML document:

Hello world!

This is some text.

Visit runoob.com!

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the text property.


Definition and Usage

HTML5 no longer supports the text attribute. Please use CSS instead.

The text attribute was deprecated in HTML 4.01. in HTML 4.01.

The text attribute specifies the text color of the HTML document.


Compatibility notes

In HTML 4.01, the text attribute of the body element is deprecated; in XHTML 1.0 Strict DTD, the text attribute of the body element is not supported. Please use CSS instead.

CSS syntax ( section):

CSS example: set the text color in the document

In our CSS tutorial, you can find more details about text color attribute knowledge.


Syntax

HTML tag