How to adjust font color in css

王林
Release: 2023-01-03 09:27:42
Original
3590 people have browsed it

The method to adjust the font color in css is: you can use the color attribute to set the font color, such as [color: #92a8d1;] or [color:rgb(255,0,51)].

How to adjust font color in css

The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.

It is very simple to set the color of the font. CSS provides us with the color attribute, using which we can adjust the color of the font at will.

Attribute introduction:

The Color property specifies the color of the text.

Attribute value:

  • The name of the color The name of the color, such as red, blue, brown, lightseagreen, etc., is not case sensitive

  • Hexadecimal Hexadecimal symbols #RRGGBB and #RGB (such as #ff0000)

  • ##RGB, red-green-blue (red -green-blue (RGB)) specifies that the color value is the color of the rgb code, the function format is rgb(R,G,B), and the value can be an integer or percentage from 0-255.

Example 1:

The color is a hexadecimal value

    php.cn  

这是标题

段落文本的颜色为 16 进制值。

Copy after login

Running result:


How to adjust font color in css

(Learning video sharing:

css video tutorial)

Example 2:


Color value is RGB:

    php.cn  

这是标题

段落文本的颜色为 16 进制值。

Copy after login

Running results:


How to adjust font color in css

Related recommendations:

CSS tutorial

The above is the detailed content of How to adjust font color in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!