Can I set background image and opacity in the same property?

后端 未结 14 1944
南笙
南笙 2020-11-22 07:58

I can see in CSS references how to set image transparency and how to set a background image. But how can I combine these two in order to set a transparent background image?<

14条回答
  •  抹茶落季
    2020-11-22 08:29

    Two methods:

    1. Convert to PNG and make the original image 0.2 opacity
    2. (Better method) have a
      that is position: absolute; before #main and the same height as #main, then apply the background-image and opacity: 0.2; filter: alpha(opacity=20);.

提交回复
热议问题