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

后端 未结 2 1281
有刺的猬
有刺的猬 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. */
    

提交回复
热议问题