悬停效果在IE中不起作用

时间:2015-05-26 13:32:47

标签: javascript html css css3

尝试实现简单的悬停效果 - 它在Chrome中可爱但在MSIE中不可用。还有其他选择吗?或者是一个可以在MSIE中使用的修复程序?我尝试过的大多数悬停/翻转效果在IE中都有这个问题。

normalize.css
demo.css
set2.css
font-awesome.min.css

加价 - 页面

<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
<head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
        <meta name="viewport" content="width=device-width, initial-scale=1"> 
        <link href='http://fonts.googleapis.com/css?family=Raleway:400,800,500,600' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" type="text/css" href="../Style Library/css/normalize.css">
        <link rel="stylesheet" type="text/css" href="../Style Library/css/demo.css">
        <link rel="stylesheet" type="text/css" href="../Style Library/css/set2.css">
        <link rel="stylesheet" type="text/css" href="../Style Library/fonts/font-awesome-4.2.0/css/font-awesome.min.css"
</head>

<body>
        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js" type="text/javascript" ></script>
        <div class="container">

            <div class="content">
                <h2>Goliath</h2>
                <div class="grid">
                    <figure class="effect-goliath">
                        <img src="Site%20Documents/23.jpg" alt="img23"/>
                        <figcaption>
                            <h2>Thoughtful <span>Goliath</span></h2>
                            <p>When Goliath comes out, you should run.</p>
                            <a href="#">View more</a>
                        </figcaption>           
                    </figure>
                    <figure class="effect-goliath">
                        <img src="Site%20Documents/24.jpg" alt="img24"/>
                        <figcaption>
                            <h2>Thoughtful <span>Goliath</span></h2>
                            <p>When Goliath comes out, you should run.</p>
                            <a href="#">View more</a>
                        </figcaption>           
                    </figure>
                </div>
        </div><!-- /container -->

    </body>
</html>

在Chrome中正常工作(光标悬停在右侧面板上) Working correctly in Chrome (cursor hovered on the right panel)

在MSIE 11中,不工作:( in MSIE 11, not working :(

1 个答案:

答案 0 :(得分:3)

  1. 将标记放在W3C HTML Validator中并修复所有错误。 Internet Explorer特别不喜欢无效的HTML标记,除此之外还有一个未公开的<div>元素。

  2. 您的上一个<link>代码缺少其结束括号>

    <link rel="stylesheet" type="text/css" href="../Style Library/fonts/font-awesome-4.2.0/css/font-awesome.min.css"
    
  3. 您的CSS路径的href网址中有一个空白字符,触发W3C错误href="../Style Library/css/normalize.css"。尝试通过重命名它来摆脱它。 Play it safe and avoid whitespace within any URL

  4. 您从未明确说明哪个版本的资源管理器。