How do you work around IE not supporting :after?

前端 未结 8 1672
無奈伤痛
無奈伤痛 2021-01-21 21:07

I\'ve got a bunch of lists

  • Item 1
  • Item 2
  • Item 3
  • &l
8条回答
  •  爱一瞬间的悲伤
    2021-01-21 21:36

    If your content is not intented to change at runtime, you could use the following :

    .icon-glass {
      *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');
    }
    

    If your content is intended to change at runtime, you could do something like this :

    .icon-glass {
      *top:expression(0, this.innerHTML = '');
    }
    

    Unfortunately, this is extremely slow. While it is likely to work in IE6 with a significant reduction of your performance, IE7 is likely to crash if you have too many icons on your page. So I wouldn't recommend this second technique unless you use only very few icons and you can afford the performance reduction.

提交回复
热议问题