Arrow

CSS Text Color

AuthorHariom Prajapati

Pubish Date27 Aug 2022

categoryCSS

It is use to set the color of text.

 

Syntax -

color:value;

 

values

color names

RGB color

HEX color HSL color
HSLA Color  

 

For example -

<!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>Text Color</title>

    <style>
        h1 {
            color: rgb(0, 81, 255);
        }

        h2 {
            color: lime;
        }
    </style>
</head>

<body>
    <h1>welcome to teknowize</h1>
    <h2>Learn Programming</h2>
</body>

</html>

 

Output

text color