Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set background Picture Transparency by css

Shulou Source: shulou.com Published: 2022-06-03 05:19:20 11月06日 Update

This article mainly shows you "css how to set background picture transparency", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "css how to set background picture transparency" this article.

In css, you can use the opacity attribute to set the transparency of the background image. The function of this attribute is to set the transparency of the element. You only need to add the "opacity: transparency value;" style to the element with the background image set.

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

In css, you can use the opacity property to set the transparency of the background image.

The Opacity attribute sets the transparency level of an element from 0. 0 (fully transparent) to 1. 0 (completely opaque).

Code example:

Div {width: 400px; height: 230px; background:url (img/3.jpg) no-repeat; background-size: 400px 226px } .box {opacity: 0.5;}

Effect picture:

The above is all the content of the article "how to set background picture transparency in css". 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: Pictures backgrounds background pictures attributes transparency elements content articles levels learning help code functions that is effects renderings tutorials easy to understand more organized Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS NVidia Microsoft OPPO Reno Shulou Tech Info