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 css3 sets the background gray and transparency

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

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!

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: 0

*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