Home>Article>Web Front-end> How to set font size and font color in css
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.
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:
2. Use the color attribute to set the font color
Demo code:
.demo1{color: #FF0000;}
Example:
Document 文字颜色1
文字颜色2
Output result:
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!