1. Color Names
You can choose any one color from the list of color names and use it as the value of the color property in the style attribute (
Example:
<p style="color:red;"> The color red is used in this text. </p>
Output:
The color red is used in this text.
List of Color Names as follows:
- Red
- Green
- Yellow
- Blue
- Black
- White
- Orange
- Pink
- Purple
- Brown
- Gray
- Cyan
- Magenta
- Lime
- Navy
- Maroon
- Olive
- Teal
- Silver
- Gold
2. Hex Color Codes
You can choose any hexadecimal color code and use it as the value of the color property in the style attribute (
Example:
<p style="color:#ff0000;"> This example uses a hexadecimal color code in a line. </p>
Output:
This example uses a hexadecimal color code in a line.
List of Common Hexadecimal Color Codes as follows:
- #ff0000 → Red
- #00ff00 → Green
- #0000ff → Blue
- #ffff00 → Yellow
- #000000 → Black
- #ffffff → White
- #ffa500 → Orange
- #800080 → Purple
- #ffc0cb → Pink
- #808080 → Gray
