开发者

IE9 :hover Glitch

开发者 https://www.devze.com 2023-04-12 03:51 出处:网络
I have some really odd behavior surfacing with IE9, :hover, and the CSS background property. It\'s almost as if the hover and non-hover properties swap when they aren\'t supposed to (In other words,

I have some really odd behavior surfacing with IE9, :hover, and the CSS background property.

It's almost as if the hover and non-hover properties swap when they aren't supposed to (In other words, the hover properties become the non-hover properties). I was testing just with a background color, as well as an SVG gradient. Here's the test code (with the SVG code commented out).

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
    .highlights {           
        background:black;

        /* SVG background gradient for #0791F3 to #068CE0 */    
        /*
        background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9ImczMDkiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwNzkxRjMiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiMwNjhDRTAiIG9mZnNldD0iMSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2czMDkpIiAvPgo8L3N2Zz4=);
        */

    }


    .highlights:hover {
        background:gray;

        /* SVG background gradient for #0064ff to #0051ff */
        /*
        background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc0NDEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wI开发者_运维百科HN0b3AtY29sb3I9IiMwMDY0RkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiMwMDUxRkYiIG9mZnNldD0iMSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2c0NDEpIiAvPgo8L3N2Zz4=);
        */

    }

</style>
</head>
<body>

<div class="highlights">
    <h3 class="title" style="color:#FED704">The Quick Brown Fox Jumps Over The Lazy Dog</h3>
    <p style="color:white;">This is smaller text</p>
</div>

</body>
</html>

[edit]: Video of the odd behavior (remember, the background should appear gray on a hover): http://www.youtube.com/watch?v=8D4Oj25bPlg


Software rendering was not enabled. As soon as I enabled it, the issue vanished.

Internet Options > "Advanced tab" > check "Use software rendering instead of GPU rendering"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号