IE bug: absolutely-positioned element with a non-transparent background colour

后端 未结 2 1279
有刺的猬
有刺的猬 2021-01-27 07:53

I have an absolutely-positioned DIV that I need to trap onclick events for. It turns out that, in IE7, the DIV seems to have no \'footprint\' for things like clicking and even c

相关标签:
2条回答
  • 2021-01-27 08:20

    Try using a transparent background image.

    I would suggest using a 2x2 or bigger .gif that is all transparent pixels. Set it to repeat on x and y and IE shouldn't have an issue with the clicks.

    background: transparent url(path/to/spacer.gif) repeat left top;
    /* Not all of that is necessary, but I have a tendency to define it anyway. */
    
    0 讨论(0)
  • 2021-01-27 08:33

    Had the same problem and didnt found a better solution than the transparent gif. Note that this problem also occured in IE8 for me. You don't have to use a 2x2 px gif, 1x1 px is enough.

    0 讨论(0)
提交回复
热议问题