- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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>
- Related Articles
- Define colors using the Red-Green-Blue model (RGB) with CSS
- Define colors using the Hue-Saturation-Lightness-Alpha model (HSLA) with CSS
- Define colors using the Hue-Saturation-Lightness model (HSL) with CSS
- CSS Transparency Using RGBA
- Define the CSS Box Model
- How to convert a colored image to blue/green/red image using Java OpenCV library?
- CSS rgba() Function
- What do we observe on pouring acetic acid on red and blue litmus papers?(A) Red litmus remains red and blue litmus turns red.(B) Red litmus turns blue and blue litmus remains blue.(C) Red litmus turns blue and blue litmus turns red.(D) Red litmus becomes colourless and blue litmus remains blue.
- Usage of rgba() CSS function
- List with a blue left border using CSS
- A jar contains 12 red balls, 4 blue balls, and 4 green balls. What is the probability of getting a green ball?
- A student covered a torch with red cellophane sheet to obtain red light. Using the red light she obtains a shadow of an opaque object. She repeats this activity with green and blue light. Will the colour of the light affect the shadow? Explain.
- Define skew transforms along with x axis using CSS
- Define skew transforms along with y axis using CSS
- The colours of aqueous solutions of CuSO4 and FeSO4 as observed in the laboratory are:(a) Pale green and light blue respectively. (b) Light blue and dark green respectively.(c) Dark blue and dark green respectively. (d) Dark blue and pale green respectively.

Advertisements