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

How to set font color in html

coldplay.xixi
coldplay.xixiOriginal
2021-04-28 15:14:0334567browse

htmlHow to set font color: 1. Set through external CSS style; 2. Set through internal CSS style; 3. Set through font tag.

How to set font color in html

The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer.

htmlHow to set font color:

1. Set through external CSS style. 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 set 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 set 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 set font color in html

Related learning recommendations: html video tutorial

The above is the detailed content of How to set 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 use spaces in htmlNext article:How to use spaces in html