Font content"; the color attribute can specify the color of the font text, The font-size attribute sets the font size."/> Font content"; the color attribute can specify the color of the font text, The font-size attribute sets the font size.">
Home > Article > Web Front-end > What is the code to change font color and size in html
The code to change the font color and size in html is "
Font content name>" ;The color attribute can specify the color of the font text, and the font-size attribute can set the font size.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Change the font color in html
In html, if you want to change the font color, you can use the color attribute
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <p>测试文本,默认字体颜色</p> <p style="color: red;">测试文本,字体颜色设置为红色</p> </body> </html>
Changing the font size in html
In html, if you want to change the font color, you can use the font-size attribute
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <p>测试文本,默认字体大小</p> <p style="font-size: 20px;">测试文本,字体大小设置为20px</p> </body> </html>
Related recommendations: "html video tutorial"
The above is the detailed content of What is the code to change font color and size in html. For more information, please follow other related articles on the PHP Chinese website!