How to Use Text Color Tags in HTML

This article explains how to change the font color in HTML documents. Although the HTML style tag is obsolete in HTML5, you can use CSS to color content on an HTML page. If you use an older version of HTML, you can use the HTML text color tag as needed.

Use CSS

Picture 1 of How to Use Text Color Tags in HTML

Choose a color for the content. While you can use basic colors (like "red") to color your text, you'll still need to use the HTML color generator to create more tones:

Visit https://www.w3schools.com/colors/colors_picker.asp in your computer's browser.

Select the background color you want to use in the hexagon at the top of the page.

Drag down the color tone you want to use on the right side of the page.

Note down the 6-character code to the right of the color tone.

Picture 2 of How to Use Text Color Tags in HTML

Open the HTML document. This is the text whose font color you want to change.

If you don't have an HTML document yet, create one before continuing.

Picture 3 of How to Use Text Color Tags in HTML

Find the content you want to colorize. Scroll through the text until you find the paragraph, heading, or other content you want to color.

Picture 4 of How to Use Text Color Tags in HTML

Note the content's tags. For example, if content is a heading, you'll see "

" in front of.

Picture 5 of How to Use Text Color Tags in HTML

Add "head" and "style" to the top of the text. You will do this by typing under the "" tag, press ↵ Enter, enter", rồi nhập đoạn mã sau (bạn nhớ thay red bằng mã màu và "

" with the tag for the content you want to color):

{ color: red; }

Picture 6 of How to Use Text Color Tags in HTML

Review the text. The page heading will look like this:

 
Update 20 May 2024
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile