Home  >  Article  >  Web Front-end  >  How to change font color in html

How to change font color in html

藏色散人
藏色散人Original
2021-03-29 11:41:4238945browse

htmlHow to change the font color: 1. Set the font color through external CSS styles; 2. Set the font color through internal CSS styles; 3. Set the font color through the font tag.

How to change font color in html

The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer

HTML is mainly used to write page layout, and it is often used in the process. It is necessary to set the color of some fonts on the page. There are usually three common ways to customize the settings:

1. Set through external CSS styles. You can add style to the head tag, and add class="the name defined in the above style, such as blue" to other tags in the body, such as h1, p, div and other start tags. The code is implemented as follows:

How to change font color in html

#2. Set through internal CSS styles. In other tags in the body, such as h1, p, div and other start tags, just add style="color:white;font-size:25px;". The code is implemented as follows:

How to change font color in html

#3. Set through the font tag. In the content of other tags in the body, add the font tag to set the font color and size, such as color="yellow" size="5". It should be noted that the maximum value of size is 7, and the font color and size are assigned using the equal sign. The first two CSS styles are assigned using English colons. The code is implemented as follows:

How to change font color in html

Recommended learning: "HTML Video Tutorial"

The above is the detailed content of How to change font color in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to hide music in htmlNext article:How to hide music in html