Let's understand how to specify the color

I will explain how to specify color in HTML.

Color name

Here are some color names.

color: red;
color: blue;
color: green;
color: white;
color: black;

It's easy to specify a color name, but in principle, you shouldn't use it in web design.

Basically, it is recommended to use RGB color code.

I feel that white is relatively used in some situations.

For black, it is recommended to use a color code because it is often fine-tuned to adjust the darkness.

Color code

I will briefly explain the color code.

White is #ffffff

When the intensity of red, green and blue is maximized, it becomes "white".

White
<div style = "background: green; color: #ffffff">
  White
</div>

You can easily use "#fff".

Black is # 000000

When the intensity of red, green and blue is all minimized, it becomes "black".

Black
<div style = "color: # 000000">
  Black
</div>

You can easily use "# 000".

The primary color red is # ff0000

When the intensity of red is maximum and the others are minimum, it becomes "primary red".

Primary color red
<div style = "color: # ff0000">
  Primary color red
</div>

You can easily use "# f00".

The primary color green is # ff0000

When the intensity of green is maximum and the others are minimum, it becomes "primary green".

Primary color green
<div style = "color: # 00ff00">
  Primary color green
</div>

You can easily use "# 0f0".

The primary color blue is # 0000ff

When the intensity of blue is maximum and the others are minimum, it becomes "primary blue".

Primary color blue
<div style = "color: # 0000ff">
  Primary color blue
</div>

You can easily use "# 00f".

Color is expressed by a combination of red, green and blue intensities

Color is represented by a combination of red, green and blue intensities. First of all, this is the basics, so let's remember.

How to get the color code?

It's easiest to use a google color swatch for the color code.

google swatch

Let's see what kind of color becomes what kind of color code.

Let's see what the strength of red, green and blue is.

Associated Information