How to make the background DIV only transparent using CSS

后端 未结 8 769
予麋鹿
予麋鹿 2020-12-02 22:31

I am using CSS attrubutes :

filter: alpha(opacity=90);    

opacity: .9;

to make the DIV transparent,

8条回答
  •  抹茶落季
    2020-12-02 23:17

    I had the same problem, this is the solution i came up with, which is much easier!

    Make a little 1px x 1px transparent image and save it as a .png file.

    In the CSS for your DIV, use this code:

    background:transparent url('/images/trans-bg.png') repeat center top;
    

    Remember to change the file path to your transparent image.

    I think this solution works in all browsers, maybe except for IE 6, but I haven't tested.

提交回复
热议问题