IE8: Div hover only works when background color is set, very strange, why?

后端 未结 8 1656
遇见更好的自我
遇见更好的自我 2020-12-10 04:55

Situation: Got a div with buttons images. Div needs to fadeIn on hover. Works in all browsers, except Internet Explorer. When I give the div a background co

8条回答
  •  天涯浪人
    2020-12-10 05:18

    I've got the same problem with IE8 using HTML5. My solution was inspired by Herman's. I set a background image and then I'm creating background from non-existing part of it. Basically, I'm asking the browser to display something that is beyond image's dimensions.

    background: url(myimage.png) 300px 0px no-repeat;
    

    To avoid unnecessary traffic it can be website's sprite or any other valid image that it's already being used on the page.

提交回复
热议问题