All HTML Color Codes List
HTML color codes are used to specify colors in web pages. There are two main types of color codes:
1. Hexadecimal Color Codes:
- These codes are written as six hexadecimal digits, preceded by a '#' symbol.
- Each digit represents a color channel: red, green, and blue (RGB).
- The value for each channel ranges from 00 to FF (0 to 255 in decimal).
- For example,
#FF0000
represents red,#00FF00
represents green, and#0000FF
represents blue.
2. Color Names:
- HTML also supports a list of predefined color names, such as "red", "green", "blue", "black", "white", etc.
- These names are case-insensitive.
- You can use the name directly in your HTML code, for example:
<p style="color: red;">This text is red</p>
.
Here is a list of all the HTML color codes:
Basic Colors:
Color Name | Hex Code |
---|---|
Black | #000000 |
White | #FFFFFF |
Red | #FF0000 |
Green | #00FF00 |
Blue | #0000FF |
Yellow | #FFFF00 |
Cyan | #00FFFF |
Magenta | #FF00FF |
Other Colors:
Color Name | Hex Code |
---|---|
Aqua | #00FFFF |
Azure | #F0FFFF |
Beige | #F5F5DC |
Brown | #A52A2A |
Coral | #FF7F50 |
Crimson | #DC143C |
Gold | #FFD700 |
Gray | #808080 |
Indigo | #4B0082 |
Ivory | #FFFFF0 |
Lavender | #E6E6FA |
Lime | #32CD32 |
Maroon | #800000 |
Navy | #000080 |
Olive | #808000 |
Orange | #FFA500 |
Pink | #FFC0CB |
Purple | #800080 |
Silver | #C0C0C0 |
Teal | #008080 |
Violet | #EE82EE |
Using Color Codes in HTML:
You can use color codes in your HTML code using the style
attribute:
This text is red.
This text is green.
You can also use color codes in your CSS files:
p {
color: #FF0000;
}
This will make all paragraph elements on your web page red.
Choosing the Right Color Code:
When choosing a color code, consider the following:
- Contrast: Make sure your text and background colors have enough contrast to be easily readable.
- Color Harmony: Choose colors that complement each other and create a visually appealing design.
- Brand Colors: If you are designing a website for a company or organization, use their brand colors.
- Accessibility: Choose colors that are accessible to people with visual impairments.
By understanding how to use HTML color codes, you can create visually appealing and effective web pages.