Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

HTML Color Code - Color Code Table in HTML

Learn about HTML Color Code, including Color Name, key uses, practical steps, common issues, and answers to frequently asked questions.

Table of Contents

Color Name

This guide provides a clear overview of html color code, including Color Name, Color Name Supported by All Browsers. Use it to understand the topic, compare the available options, and make a more informed decision.

Eg:

Color Name
Color Name - HTML Color Code Red
Yellow
Glaucous
Blue
Bright red

Color Name Supported by All Browsers

All modern browsers support the following 140 color names (click the color name or hex value, to see the color as a background color along with different text colors):

Color Name Supported by All Browsers - HTML Color Code

CSS Color Values

With CSS, colors can be specified in a variety of ways:

  • By color name
  • As RGB value
  • As a hexadecimal value
  • As HSL (CSS3) value
  • As HWB value (CSS4)
  • With keyword currentcolor

RGB Color

RGB color values are supported in all browsers.

RGB color values are specified with: rgb (RED, GREEN, BLUE).

Each parameter that defines the intensity of the color is an integer between 0 and 255.

For example, rgb(0,0,255) is displayed as blue, because the blue parameter is set to the highest value (255) and the other parameters are set to 0.

Eg:

Color RGB Color

RGB Color - HTML Color Code

rgb(255,0,0) Red
rgb(0,255,0) Green
rgb(0,0,255) Blue

Shades of gray are usually determined using equal values for all 3 light sources:

Eg:

Color RGB Color
RGB Color - HTML Color Code rgb(0,0,0) Black
rgb(128,128,128) gray
rgb(255,255,255) White

Hexadecimal Color

Hexadecimal color values are also supported in all browsers.

Hexadecimal colors are specified with: #RRGGBB.

RR (red), GG (green), and BB (blue) are hexadecimal integers from 00 to FF specifying the intensity of the color.

For example, #0000FF is displayed as blue, because the blue component is set to the highest value (FF) and the others are set to 00.

Eg:

Color HEX RGB Color
Hexadecimal Color - HTML Color Code #FF0000 rgb(255,0,0) Red
#00FF00 rgb(0,255,0) Green
#0000FF rgb(0,0,255) Blue

Shades of gray are usually determined using equal values for all 3 light sources.

Eg:

Color HEX RGB Color
Hexadecimal Color - HTML Color Code #000000 rgb(0,0,0) Black
#808080 rgb(128,128,128) gray
#FFFFFF rgb(255,255,255) White

Note: You can use uppercase or lowercase letters to specify hexadecimal values. Lowercase letters are easier to write, and uppercase letters are easier to read.

Keyword Currentcolor

The currentcolor keyword refers to the color property value of an element.

For example, the border color of the following element would be blue because the element's text color is blue:

#myDIV { color: blue; /* Blue text color */ border: 10px solid currentcolor; /* Blue border color */ }

Conclusion

Understanding HTML Color Code makes it easier to compare options, avoid common mistakes, and apply the information in this guide more effectively. Review the relevant requirements before making changes or choosing a solution.

FAQ

What is HTML Color Code?

RGB color values are specified with: rgb (RED, GREEN, BLUE).

Why is HTML Color Code important?

Understanding HTML Color Code helps you evaluate features, compatibility, performance, and potential limitations before you choose a product or follow a procedure.

What should you consider when using or choosing HTML Color Code?

Consider your specific goal, compatibility requirements, available features, cost, security, and the practical recommendations described in this guide.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.