RGBA is a CSS color that can set color values and transparency
Below is white using rgba() to set 50% transparency.
p {
color: rgba(255, 255, 255, 0.5);
}
RGBA is an extension of the RGB color model. This acronym stands for the first letters of the three primary colors red, green, and blue, and the alpha value represents the transparency/opacity of the color.
RGBA syntax
The format of RGBA color representation is:
rgba(red, green, blue, alpha)
The first three values (red, green and blue) range from integers between 0 and 255 or percentages between 0% and 100%. These values describe the amount of the three primary colors red, green, and blue in the intended color.
If you want to set pure red, then set the red parameter to full, that is, 255, and set the green and blue parameters to 0.
background-color: rgba(255, 0, 0, 1);
result:
Percents can also be used:
background-color: rgba(100%, 0%, 0%, 1);
result:
The fourth value, alpha, specifies the transparency/opacity of the color and ranges from 0.0 to 1.0
The following example is yellow with 50% transparency:
color: rgba(255, 242, 0, 0.5);
CSS translucency is compatible with Firefox, IE, and Chrome. The current browser versions are relatively high. You can feel free to use it in your project.