Easy Tutorial
❮ Pr Print Pageba Pr Text Text Decoration ❯

CSS rgba() Function

CSS Functions

Example

Using RGBA colors with transparency:

#p1 {background-color:rgba(255,0,0,0.3);} /* Red */
#p2 {background-color:rgba(0,255,0,0.3);} /* Green */
#p3 {background-color:rgba(0,0,255,0.3);} /* Blue */

Definition and Usage

The rgba() function uses red (R), green (G), blue (B), and alpha (A) values to create a variety of colors.

RGBA stands for Red, Green, Blue, Alpha.

Supported in: CSS3


Browser Support

The numbers in the table specify the first browser version that fully supports the function.

Function Chrome IE Firefox Safari Opera
rgba() 1.0 9.0 3.0 3.1 10.1

CSS Syntax

rgba(red, green, blue, alpha)
Value Description
red Defines the red value, range 0 to 255, or a percentage 0% to 100%.
green Defines the green value, range 0 to 255, or a percentage 0% to 100%.
blue Defines the blue value, range 0 to 255, or a percentage 0% to 100%.
alpha - transparency Defines the transparency, range 0 (fully transparent) to 1 (fully opaque).

CSS Functions

❮ Pr Print Pageba Pr Text Text Decoration ❯