values. Hex values are in reality an alternate method for addressing RGB values. Rather than using three numbers in the range of 0 and 255 , you use six hexadecimal numbers. Hex numbers can be 0-9 and A-F .
CSS uses color values to determine a color. Regularly, these are utilized to set a color either for the foreground of a component (i.e., its text>
or, background of the component. They can likewise be used to affect the color of lines, borders and other decorative impacts.
How many colors does CSS provide?
145 Colors.
CSS gives 145 colors names, from the most basic(black, white, orange, yellow, blue… >
to the more specific (lawngreen, orchid, crimson...>
.
How to change colors using CSS?
Changing the Color of text on a site page is simple with the CSS color property. Before we see how, it's essential to understand the various ways you can set the property values. You can use: HTML names: color names There are 140 shading names upheld in CSS. Yellow, fuchsia, maroon, and skyblue are only a couple of examples. Hex color codes: These codes are made out of three sets of characters that address the force of the three primary colors. Potential qualities range from 00 (the most minimal power of an primary colors>
to FF (the most noteworthy force of an primary colors>
. The hex color code for black is #000000, red is #FF0000, and blue is #0000FF. RGB values: RGB is one more color model dependent on the blend of the primary colors red, green, and blue. Made out of three numbers separated by commas, each addresses the power of the particular essential tone as a whole number somewhere in the range of 0 and 255. black is rgb (0, 0, 0>
, red is rgb (255, 0, 0>
, and blue is rgb (0, 0, 255>
.
The default background color for a page is defined in the body selector.
Let's see an example using color name:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: orange;
}
</style>
</head>
This page has a orange background color!
</body>
</html>
Output:

Try it here
Let's see an example using hexadecimal value:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #FFFF00;
}
</style>
</head>
This page has a yellow background color!
</body>
</html>
Output:

Try it here
Let's see an example using rgb color codes:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: rgb(0,100,0>
;
}
</style>
</head>
This page has a green background color!
</body>
</html>
Output:

Try it here