What does the "a" in rgba mean? CSS RGBA Color Guide

What does the "a" in rgba mean? CSS RGBA Color Guide

RGBA is a CSS color that can set color value and transparency

Below is the use of rgba() to set the white color to 50% transparency.

p {
color: rgba(255, 255, 255, 0.5);
}

RGBA is an extension of the RGB color model. This acronym stands for the initials 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 0 to 255 as integers or from 0% to 100% as percentages. These values ​​describe the amounts of the three primary colors red, green and blue that are present in the intended color.
If you want to set pure red, set the red parameter to 255, and set green and blue to 0.

background-color: rgba(255, 0, 0, 1);

result:

Percentages 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 sets the yellow color to 50% transparency:

color: rgba(255, 242, 0, 0.5);

CSS translucency is compatible with Firefox, IE, and Chrome, and the current browser versions are relatively high. You can use it in your project with confidence.

<<:  3D tunnel effect implemented by CSS3

>>: 

Recommend

Summary of MySQL lock related knowledge

Locks in MySQL Locks are a means to resolve resou...

Docker compose custom network to achieve fixed container IP address

Due to the default bridge network, the IP address...

Using js to achieve the effect of carousel

Today, let's talk about how to use js to achi...

VMware Workstation 14 Pro installation Ubuntu 16.04 tutorial

This article records the specific method of insta...

CSS3 uses scale() and rotate() to achieve zooming and rotation

1. scale() method Zoom refers to "reducing&q...

Solve the problem that the time zone cannot be set in Linux environment

When changing the time zone under Linux, it is al...

Install zip and unzip command functions under Linux and CentOS (server)

Install zip decompression function under Linux Th...

Detailed tutorial on Docker pulling Oracle 11g image configuration

Without further ado Start recording docker pullin...

How to manage users and groups when running Docker

Docker is a management tool that uses processes a...

How to choose and use PNG, JPG, and GIF as web image formats

So which one of these formats, GIF, PNG, and JPG,...

Detailed explanation of lazy loading and preloading of webpack

Table of contents Normal loading Lazy Loading Pre...

Implementation of running springboot project with Docker

Introduction: The configuration of Docker running...

Vue Beginner's Guide: Environment Building and Getting Started

Table of contents Initial Vue Building a Vue deve...