CSS3 rgba color property

CSSWeb DevelopmentFront End Technology

RGBA stands for Red Green Blue Alpha. It is an extension of CSS2, Alpha specifies the opacity of a color and parameter number is numerical between 0.0 to 1.0.

Example

The following example shows rgba color property −

Live Demo

<html>
   <head>
      <style>
         #p1 {background-color:rgba(255,0,0,0.3);}
         #p2 {background-color:rgba(0,255,0,0.3);}
         #p3 {background-color:rgba(0,0,255,0.3);}
      </style>
   </head>
   <body>
      <p>RGBA colors:</p>
      <p id = "p1">Red</p>
      <p id = "p2">Green</p>
      <p id = "p3">Blue</p>
   </body>
</html>
raja
Published on 02-May-2018 09:31:37
Advertisements