Home >Web Front-end >CSS Tutorial >How to set body font color in css
In CSS, you can use the color attribute to set the body font color. You only need to set the "color: color value" style to the body element. The color attribute specifies the color of the text. This property sets the foreground color of an element. This color is also applied to all borders of the element unless overridden by other border color properties.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
First of all, let’s show you the basic code of the html font:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>document</title> </head> <body> <p>字体颜色设置</p> <p>字体颜色设置</p> <p>字体颜色设置</p> <p>字体颜色设置</p> </body> </html>
Here are the four paragraphs of the p tag. We should all understand it. This is the simplest code style.
Next we need to set the html font color. Let’s take a look at the css style code:
<style type="text/css"> body { 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. Tips and NotesTips: Please use a reasonable combination of background color and text color to improve the readability of the text. Recommended learning:The above is the detailed content of How to set body font color in css. For more information, please follow other related articles on the PHP Chinese website!