Home >Daily Programming >HTML Knowledge >Complete html color code table

Complete html color code table

David Beckham
David BeckhamOriginal
2024-04-19 15:08:081387browse

HTML color codes are 6-digit hexadecimal codes that specify RGB values ​​for web page colors. You can set the color of text, background, and other elements by using code of the format #rrggbb in HTML or CSS. Commonly used HTML color codes include black, white, red, green, blue, yellow, magenta, cyan, purple, etc. Additionally, colors can be specified using color names (such as aqua, red, etc.).

Complete html color code table

HTML color code table collection

What are HTML color codes?

HTML color codes are 6-digit hexadecimal codes used to specify the color of text, background, and elements on web pages. It consists of a pound sign (#) followed by 6 digits representing red, green, and blue (RGB) values.

Color code format:

<code>#rrggbb</code>

Where:

  • rr: Red (00-FF)
  • gg: Green (00-FF)
  • bb: Blue (00-FF)

How to use HTML color codes?

You can use color codes in HTML and CSS to set the color of elements.

HTML:

<code class="html"><p style="color: #ff0000;">这是红色的文本</p></code>

CSS:

<code class="css">p {
  color: #ff0000;
}</code>

HTML Color Code Chart

The following are commonly used HTML color codes:

  • Black: #000000
  • White: #FFFFFF
  • Red: #FF0000
  • Green: #00FF00
  • Blue: #0000FF
  • Yellow: #FFFF00
  • Magenta: #FF00FF
  • Cyan: #00FFFF
  • Purple: #800080
  • Gray: #808080

##Other HTML color codes:

Colors can also be specified using color names. Here are some commonly used color names:

  • aqua: #00FFFF
  • fuchsia: #FF00FF
  • lime:#00FF00
  • maroon:#800000
  • navy:#000080
  • olive:#808000
  • purple:#800080
  • red:#FF0000
  • silver:#C0C0C0
  • teal:#008080
  • white:#FFFFFF
  • yellow :#FFFF00

The above is the detailed content of Complete html color code table. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn