How to set css font color: First create an HTML sample file; then define some p tags in the body and enter text content in the p tags; finally add the css style to the p tags as "p{color: blue }" to modify the font color.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.
1. First, let’s show you the basic code of the html font:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>PHP中文网</title> </head> <body> <p>字体颜色设置</p> <p>字体颜色设置</p> <p>字体颜色设置</p> <p>字体颜色设置</p> </body> </html>
Here are the four paragraphs of the p tag, we should be able to do it Understand, this is the simplest code style.
2. Next we need to set the html font color. Let’s take a look at the css style code:
<style type="text/css"> p{color: blue} </style>
The effect is as follows:
## The #color attribute specifies the color of the text. This attribute sets the foreground color of an element (in HTML representation, the color of the element's text); raster images are not affected by color. This color also applies to all borders of the element, unless overridden by border-color or another border-color property. To set the foreground color of an element, the easiest way is to use the color attribute. 【Recommended learning:css video tutorial】
The above is the detailed content of How to set css font color. For more information, please follow other related articles on the PHP Chinese website!