Get the App
SLTechnology News&Howtos  ›  Development  › 

How css3 sets the background gray and transparency

Shulou Source: shulou.com Published: 2022-06-02 07:10:07 10月04日 Update

This article mainly shows you "how to set the background gray and transparent in css3". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to set gray and transparent background in css3".

Method: 1, use the background attribute to set the background color to gray, only need to add the "background:#c0c0c0;" style to the element; 2, use the opacity attribute to set the transparency of the element, just add the "opacity: transparency value;" style to the element.

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

In css, you can use the background attribute to set the background to gray, simply by adding a "background:#c0c0c0" style to the element.

In css, you can use the opacity attribute to set the transparency of the element, and the opacity attribute to set the opacity level of the element. Stipulate opacity. From 0.0 (fully transparent) to 1.0 (completely opaque).

Examples are as follows:

Document .div1 {width:200px; height:200px; background:#c0c0c0;} .div2 {width:200px; height:200px; background:#c0c0c0; opacity:0.5;} set gray: set gray and transparency:

Output result:

The above is all the content of the article "how to set the background gray and transparent in css3". 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!

Tags: Transparency gray elements background attributes content styles articles learning help tutorials methods understandability more organization environment computers knowledge examples systems Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MariaDB Shulou Information MySQL Linux