Home>Article>Web Front-end> How to set font size and font color in css

How to set font size and font color in css

WBOY
WBOY Original
2021-11-12 09:25:05 10688browse

In CSS, you can use the "font-size" and color attributes to set the font size and font color. You only need to add "{font-size: font size value; color: color value;}" to the font element. Just style it.

How to set font size and font color in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to set font size and font color in css:

1. Use the font-size attribute to set the font size

Demo code:

.demo1{font-size: 20px;}

The example is as follows:

      Document  

文字大小1

文字大小2

Output result:

How to set font size and font color in css

2. Use the color attribute to set the font color

Demo code:

.demo1{color: #FF0000;}

Example:

      Document  

文字颜色1

文字颜色2

Output result:

How to set font size and font color in css

For more programming related knowledge, please Visit:Programming Video! !

The above is the detailed content of How to set font size and font color in css. 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