Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write css3 color transparency

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "css3 color transparency how to write", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "css3 color transparency how to write" this article.

Write: 1, "rgba (red, green, blue, transparency)"; rgba () function through the red, green and blue superposition to generate a variety of colors and control color transparency; 2, "hsla (hue, saturation, brightness, transparency)"; hsla () function through hue, saturation and brightness to define color and control color transparency.

The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.

How to write css3 color transparency

1. In css, you can use the rgba () function to generate a variety of colors using the superposition of red (R), green (G), blue (B) and transparency (A).

The syntax is as follows:

Rgba (red, green, blue, alpha)

Where:

Examples are as follows:

123#p1 {background-color:rgba;} # p2 {background-color:rgba;}

RGB color and use transparency:

Red

Red

Output result:

2. The hsla () function uses hue, saturation, brightness, and transparency to define colors.

HSLA means hue, saturation, brightness and transparency (English: Hue, Saturation, Lightness, Alpha).

Examples are as follows:

123#p1 {background-color:hsla (120100% 50% 0.30);} # p2 {background-color:hsla (120100% 50% 1st);}

HSL color and use transparency:

Green

Green

Output result:

The above is all the contents of the article "how to write css3 Color Transparency". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 262

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report