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

CSS3 rgba color property

PHPz
Release: 2023-08-28 20:17:13
forward
710 people have browsed it

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>
Copy after login

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

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template