Table of Contents
What is HTML color?
HTML color is used for providing different colors to your website and may provide background color, text color, border color, and many more. HTML color consists of predefined color values and names. HTML language supports a total of 140 color codes which is having separate values for identification.
Syntax- < html start tag style= “color: value;” >Your text</ html end tag >
Example-
background color
GEEKY4U.com(learn with passion)
GEEKY4U.com(learn with passion)
Geeky4u.com (Learn with Passion). This is a best platform where we are
providing best study material, best content so that it is easy for you to
learn everything and no one will stop you to become a master in
programming language
THANK YOU
Output:

How to add color to an HTML document?
HTML language allows you to add different backgrounds as well as text and border colors into your document so that your text will look more attractive. If you want to add color in the HTML document then you need to add a style tag in the HTML start tag with color followed by a color value or color name.
Syntax- < html start tag style= “color: value;” >Your text</ html end tag >
Example-
background color
GEEKY4U.com(learn with passion)
GEEKY4U.com(learn with passion)
Geeky4u.com (Learn with Passion). This is a best platform where we are
providing best study material, best content so that it is easy for you to
learn everything and no one will stop you to become a master in
programming language
THANK YOU
Output:

Different types of color styles used in HTML
Background color
The background color is used for providing background color to your text.
Syntax- < html start tag style= “Background-color: value;” >Your text</ html end tag >
Example-
background color
GEEKY4U.com(learn with passion)
Geeky4u.com (Learn with Passion). This is a best platform where we are
providing best study material, best content so that it is easy for you to
learn everything and no one will stop you to become a master in
programming language
Output:

Text color
If you want to give color to your text then text color is used. For adding text color you need to add a style tag into the HTML start tag along with color with their value and name.
Syntax- < html start tag style= “color: value;” >Your text</ html end tag >
Example-
text color
GEEKY4U.com(learn with passion)
GEEKY4U.com(learn with passion)
GEEKY4U.com(learn with passion)
Output:

Border color
Border tag used for inserting borders to your text.
Syntax- < html start tag style= “border: px value ;” > Your text</ html end tag >
Example-
border color
GEEKY4U.com(learn with passion)
GEEKY4U.com(learn with passion)
Output:

Explain RGB and RGBA color?
RGB-(red, green, blue)
RGB color is a combination of three colors that is red, green, and blue. RGB colors are generally represented by rgb (red, green, blue). RGB color has a standard color set value which is used to represent the proper intensity of a color. The color in the RGB consists of a fixed value range between (0 to 255). In this 0 represents less intensity of color and 255 represents the high intensity of color
rgb (255, 0, 0)- This value represents a red color.
rgb (0, 255, 0)- This value represents green color.
rgb (0, 0, 255)- This value represents blue color.
rgb(0, 0, 0)- This value represents black color.
rgb(255, 255, 255)- This value represents white color.
RGBA-(red, green, blue, alpha)
To represent the opacity of a color high or low alpha color is used. The range which shows the transparency of color is (0.0 to 1.0). This 0.0 represents opacity which is having very high transparency. 1.0 represents the solid color means very low transparency.
Example- (RGB)
Document
Example of rgb color
rgb (red, green, blue).
RGB color is a combination of three color that is red, green and blue. RGB
colors are generally represented by rgb (red, green, blue). Rgb color has
standard color set value which is use to represent the proper intensity of
a color. The color in the RGB consists of fixed value range between (0 to
255). this 0 represents less intensity of color and 255 represents high
intensity of color
Output:

Example- (RGBA) opacity
Document
Example of opacity
Example of opacity
Example of opacity
Example of opacity
Example of opacity
Example of opacity
Output:

Explain HEX color?
HEX color is also a combination of basic colors that is a red, green, blue color. HEX color can be written in the Hexadecimal format like #rrggbb. This (rr) is used for representing red color. (gg) is for representing green color and (bb) is used for representing blue color. HEX color also consists of fixed color value range 00 to ff means color from 0 to 255.
#ff0000-This value represents red color.
#00ff00- This value represents green color.
#0000ff- This value represents blue color.
#000000- This value represents black color.
#ffffff- This value represents white color.
Example-
Document
Example of HEX color
#ff0000-This value represents red color.
#00ff00- This value represents green color.
#0000ff- This value represents blue color.
#000000- This value represents black color.
Thank You
Output:

Explain HSL color?
HSL stands for HSL (hue, saturation, lightness).
Hue is generally used to represent the color degree which starts from 0 to 360.
- 0 is used to represent red color
- 120 is used to represent green color
- 240 is used to represent blue color
Saturation is used to represent a proper percentage of the color with saturation 0% to 100%.
Lightness is also represented in the percentage value between 0 to 100 for representing 0% as a black shade and 100% as a white shade.
Example- (variation of saturation)
Document
Example of HSL color with variations in saturation
HSL stands for HSL (hue, saturation, lightness).
color represents 80% saturation
color represents 60% saturation
color represents 40% saturation
color represents 20% saturation
Thanks
Output:

Example- (variation of lightness)
Document
Example of HSL color with variations in lightness
HSL stands for HSL (hue, saturation, lightness).
color represents 25% lightness
color represents 45% lightness
color represents 50% lightness
color represents 75% lightness
Thanks
Output:
