HTML COLORS
HTML Colors can be specified using the pre-defined color names, or using RGB, RGBA or HEX values.
Let's see how we can specify the colors using color names.
Color Name
Let's have a look at few colors:
Orange
OrangeRed
DodgerBlue
HotPink
Yellow
LightCoral
Gold
DarkKhaki
MediumPurple
DarkViolet
SlateBlue
Chartreuse
Color Values (RGB, RGBA, HSL, HEX, HSLA)
RGB, RGBA, HEX, HSL values can also be used to specify colors. Let's see how we can do that:
Color Name
Magenta
Orange
HEX Code
#FF00FF
#FFA500
RGB Code
rgb(255, 0, 255)
rgb(255, 165, 0)
Let's check an example on how we can use these colors:
<p style="color:DeepSkyBlue; background-color:darkblue;">Defining Color using Color Name</p>
<p style="color:#FFE5CC; background-color:#994C00;">Defining Color using Hex Color Code</p>
<p style="color:rgb(153, 0, 153); background-color:rgb(255, 204, 255);">Defining Color using RGB Color Code</p>
<p style="background-color:rgba(255, 215, 0, 0.5);">Defining Color using RGBA Color Code</p>
Live Demo!
Output:
Defining Color using Color Name
Defining Color using Hex Color Code
Defining Color using RGB Color Code
Defining Color using RGBA Color Code
Here's the list of some more colors: