HTML color code - color code table in html

Color name

With CSS, colors can be set using the color name.

Eg:

Color Name
HTML color code - color code table in html Picture 1 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):

HTML color code - color code table in html Picture 2

CSS Color Values

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

  1. By color name
  2. As RGB value
  3. As a hexadecimal value
  4. As HSL (CSS3) value
  5. As HWB value (CSS4)
  6. 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

HTML color code - color code table in html Picture 3

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
HTML color code - color code table in html Picture 4 rgb(0,0,0) Black
rgb(128,128,128) Grey
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
HTML color code - color code table in html Picture 5 #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
HTML color code - color code table in html Picture 6 #000000 rgb(0,0,0) Black
#808080 rgb(128,128,128) Grey
#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 */ }
3.9 ★ | 8 Vote

May be interested

  • Computer code element in HTMLComputer code element in HTML
    elements used to display computer code data in the browser
  • HTML editor onlineHTML editor online
    online html editor supports html5, when you type the opening tag automatically generates a closed tag, can detect errors related to the syntax when you are editing with the square icon with the x mark right on the error code line.
  • Standard color encoding for programmers and designersStandard color encoding for programmers and designers
    owning standard css color coding, you will be more confident when designing, web programming, because color is an indispensable part in the internet world. these are standard rgb color codes, you can memorize or save to copy when needed!
  • 4 software to help get professional color codes4 software to help get professional color codes
    the following 4 color-coded tools will help to get the color code from any image on windows without having to use photoshop.
  • Basic examples of HTMLBasic examples of HTML
    in the previous html lesson, you know which tools to use to write html code, how to save and open html files. this article will give some basic examples of html text.
  • 5 free online HTML editing tools that test the best code5 free online HTML editing tools that test the best code
    if you ask someone how to become web developers, they will tell you about javascript, python, web programming, etc. and of course html.
  • How to color the background, table color in Word, ExcelHow to color the background, table color in Word, Excel
    to present the values ​​of statistics, reports ... scientific and eye-catching, you should decorate the tables by adding more background colors to the cells in the tables. the following article helps you color the background, table color in word, excel quickly
  • The terminology of color, wheel color and skill used to colorThe terminology of color, wheel color and skill used to color
    have you ever wondered how designers can find the perfect color combination? in this article, quantrimang will work with you to learn useful terms about colors. invites you to read the track
  • Colors in HTMLColors in HTML
    in html, colors are indicated by available color names or by values ​​of rgb, hex, hsl, rgba, hsla.
  • Introduction to HTMLIntroduction to HTML
    a few basic things to know about html before starting to learn this language.