- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
<!DOCTYPE html> <html> <head> <style> h1 { background-color:hsl(0,100%,50%); } h2 { background-color:rgb(0,0,255); color: rgb(255,255,255); } p { background-color:rgba(255,0,0,0.9); } </style> </head> <body> <h1>Red Background</h1> <h2>Blue Background</h2> <p>This is demo text!</p> </body> </html>
Advertisements
To Continue Learning Please Login
Login with Google