Define colors using the Red-Green-Blue-Alpha model (RGBA) with CSS

Use the CSS rgb() function to define color using the RGB Model.

Use the CSS rgba() function to set RGB colors with opacity.

Example

You can try to run the following code to set the color with rgba() function


   
      
   
   
      

Red Background

     

Blue Background

     

This is demo text!

   
Updated on: 2026-03-11T22:50:41+05:30

236 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements