Home >Web Front-end >CSS Tutorial >CSS3 rgba color property

CSS3 rgba color property

PHPz
PHPzforward
2023-08-28 20:17:13707browse

CSS3 rgba 颜色属性

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

Example

The following example shows the rgba color attribute−

Live demonstration

<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>

The above is the detailed content of CSS3 rgba color property. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete