The way to represent colors in HTML is by using 6-digit hexadecimal codes, RGB or keywords.

The way to represent colors in HTML is by using 6-digit hexadecimal codes, RGB or keywords.
There are three ways to represent colors in HTML, the most commonly used is the 6-digit hexadecimal code representation. For example, bgcolor=#ff0000; where # simply means declaring the color using a 6-digit hexadecimal color code. The first two digits of the code, ff, represent red among the three primary colors. The range is of course 00-ff in hexadecimal. The middle two digits, 00, represent green, and the last two digits, 00, represent blue. 00 represents no color, and ff represents the strongest color. So 000000 represents black, ffffff represents white, similarly ff0000 represents pure red, 00ff00 represents pure green, and 0000ff represents pure blue.

In addition, colors can also be expressed by RGB (r, g, b). The r, g, and b in the brackets represent red, green, and blue respectively using decimal numbers or percentages from 0 to 255. For example, rgb (255, 0, 0) and rgb (100%, 0%, 0%) both represent red.

Colors can also be represented by color keywords, a total of 16, namely:

Black#000000
Maroon dark brown#800000
Green Green#008000
Olive #808000
Navy Blue#000080
Purple Purple#800080
Teal #008080
Gray Gray#808080
Silver#C0C0C0
Red Red#FF0000
Lime #00FF00
Yellow Yellow#FFFF00
Blue #0000FF
Fuchsia Magenta #FF00FF
Aqua blue#00FFFF
White#FFFFFF

For example, you can write: bgcolor=red, which is equivalent to the following:

Copy code
The code is as follows:

bgcolor=rgb(255,0,0),bgcolor=rgb(100%,0%,0%),bgcolor=#ff0000;

<<:  Linux completely removes node.js and reinstalls it through the yum command

>>:  Thoughts and experience sharing on interactive design of reading lists for information products

Recommend

How to delete a MySQL table

It is very easy to delete a table in MySQL, but y...

Case study of dynamic data binding of this.$set in Vue

I feel that the explanation of this.$set on the I...

Draw a heart with CSS3

Achieve resultsRequirements/Functionality: How to...

Solution to the lack of my.ini file in MySQL 5.7

What is my.ini? my.ini is the configuration file ...

Nginx compiled nginx - add new module

1. View existing modules /usr/local/nginx/sbin/ng...

How to limit the input box to only input pure numbers in HTML

Limit input box to only pure numbers 1、onkeyup = ...

How to count down the date using bash

Need to know how many days there are before an im...

mysql5.7 remote access settings

Setting up remote access in mysql5.7 is not like ...

How to connect to MySQL database using Node-Red

To connect Node-red to the database (mysql), you ...

Implementation of 2D and 3D transformation in CSS3

CSS3 implements 2D plane transformation and visua...

How to start multiple MySQL instances in CentOS 7.0 (mysql-5.7.21)

Configuration Instructions Linux system: CentOS-7...