简体   繁体   中英

How can I make a background transparent using css?

How can I add a background image to an element and make it transparent?

CSS doesn't provide a way to add translucency to just a background image.

You can use the opacity property to make the entire element (content and children included) translucent.

You can use rgba() colour values to make a plain background translucent.

If you want a translucent background image, your best bet is to edit the image itself (and save it in a format that supports translucency, such as PNG).

Did you mean the alpha() and opacity() property?
Take a look here http://www.w3schools.com/css/css_image_transparency.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM