html set font color:"Test and development full stack-HTML" (12) css font color attribute-Font Tutorial免费ppt模版下载-道格办公

"Test and development full stack-HTML" (12) css font color attribute

The color property in CSS is used to define the color of the text. The color value can be set to a predefined color name, or a color can be represented using hexadecimal, RGB values, or HSL values. For example, to set the text color to red, you can use th

The CSS Text (text) property can define the appearance of the text, such as the color of the text, aligned text, decorative text, text indentation, line spacing etc.

The most used It is the text color, and the color attribute is used to define the color of the text. The syntax is as follows:

div {

color:red;

}

Expression of color Has:

Predefined colors Value: red, green, pink, etc.

hexadecimal : #FF0000, #FF6600, #29D794, etc.

RGB code: rgb (255,0,0) or rgb(100%,0%,0%), etc.


Look at the effect:

The corresponding code is :

<!< /span>DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE= edge">

<meta name="viewport" content="width=device-width, initial- scale=1.0">

<title>Document</title>

<style>

div {

color: blue;

}

</< /span>style>

</< /span>head>

<body>

<div> People's Insurance said there are 7 car washes, 5 or 3 road rescues etc. </div>

</< /span>body>

</< /span>html>

All divs correspond to All are blue.


Use the second Method, expressed in hexadecimal color, first look at the effect:


The corresponding code is:

<!< /span>DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE= edge">

<meta name="viewport" content="width=device-width, initial- scale=1.0">

<title>Document</title>

<style>

/* div {

color: blue;

} */< /span>


div {

color: #FF0000;

}

</< /span>style>

</< /span>head>

<body>

<div> People's Insurance said there are 7 car washes, 5 or 3 road rescues etc. </div>

</< /span>body>

</< /span>html>


use the third at the end One way to see the effect:


The corresponding code is :

<!< /span>DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE= edge">

<meta name="viewport" content="width=device-width, initial- scale=1.0">

<title>Document</title>

<style>

/* div {

color: blue;

} */< /span>


/* div {

color: #FF0000 ;

} */< /span>


div {

color: rgb(255, 193, 100);

}

</< /span>style>

</< /span>head>

<body>

<div> People's Insurance said there are 7 car washes, 5 or 3 road rescues etc. </div>

</< /span>body>

</< /span>html>


rgb turned out to be red , green, blue, and I only found out today.


Today is the first Here it is, take a break at noon~

Articles are uploaded by users and are for non-commercial browsing only. Posted by: Lomu, please indicate the source: https://www.daogebangong.com/en/articles/detail/Test%20and%20development%20full%20stackHTML%2012%20css%20font%20color%20attribute.html

Like (810)
Reward 支付宝扫一扫 支付宝扫一扫
single-end

Related Suggestion