Every novice webmaster studying the basicscreation of sites on HTML, it is often asked by a question how to improve a created site which would differ from others by the unique design. In some cases, this is facilitated by changing the style or color of the text. In this article, you will learn in detail how to change the color of the text in html.

To change the color of the text in HTML, usespecial tags and attributes. Changing the value of attributes, you can select a particular color. To select the colors of your text, you can use the HTML color table, which you can find on the Internet in public. Now, for an example, let's see what tags are and how to use them.

Example:

<font color = "# B22222"> Text </ font>

In the example <font> is the tag responsible for changing the text, color- the attribute responsible for the color of the text, and the value "# B22222" - this is the same html color of the text that you need to change. In this example, the test color is red and the value of the color attribute is set by the number from the HTML color table. But the value can also be specified by the name of a certain color. In our example, red is "red". Then our example will look like this.

Example 2:

<font color = "red"> Text </ font>

The above examples show how to changeThe color of the HTML text in the document itself. In this way, you can select a paragraph, sentence, or even one word in the text. But there is also a way to highlight the entire text of a document, in one color or another. To do this, there is a text attribute that you want to insert into the tags <body> </ body>, between which the entire text of your page is placed. And then the same thing - insert the desired value with the help of the number or name of the desired color.

Example 3:

<body text = "red"> Text </ body>

As you can see, changing the color of the text in HTML at allnot difficult. It is enough to know some html tags the color of the text, and the color values ​​that can easily be selected from tables. However, it should be noted that such changes are now obsolete. Now for any change of text, CSS styles are responsible. But nobody forbids you to use these examples as training.

Comments 0