Problem with opacity in IE8

前端 未结 2 1607
轮回少年
轮回少年 2021-01-06 17:58

I try to solve a problem that appears in IE8. Html is very simple:

2条回答
  •  逝去的感伤
    2021-01-06 18:00

    IE8 doesn't support the CSS attribute opacity you have to use an MS filter instead:

        opacity: "0",
        filter: alpha(opacity = 50); /*change value to suit your needs*/
    

    That's not all though. This only works when the element is positioned, thankfully you have that already so it will work. For future reference if you don't have any position set, you can add zoom: 1 to the selector and it will work in IE :)

提交回复
热议问题