Background image transparency with CSS3?

后端 未结 8 2166
生来不讨喜
生来不讨喜 2020-12-29 06:41

Is there a way to add transparency to a background-image using CSS3?

8条回答
  •  醉梦人生
    2020-12-29 07:09

    There is a perfect tool named: Petteriny (transparent pixel maker) which create any transparency pattern you need . It also generate the CSS you need. here is an example what this tool makes.

    .myDiv{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQIW2NUTmk3vjun8iwjAxCAOAA2KgVERG1HmQAAAABJRU5ErkJggg==
    ) repeat;}
    

    You use it, this like this in your html

     
    
    your text over image

    In this tool it's also possible to download the pattern

提交回复
热议问题