css child(>)选择器不工作在IE8? [英] css child (>) selector not working in IE8?

查看:122
本文介绍了css child(>)选择器不工作在IE8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我收集和理解这里和那里(当我错了时停止我):
子选择器(>)在IE7 +上工作,只要你触发标准模式与你的doctype,html5的<!DOCTYPE html> 应该这样做。

From what I gathered and understood here and there (stop me when I'm wrong) : child selector (>) works on IE7+ as long as you trigger the standards mode with your doctype, html5's <!DOCTYPE html> is supposed to do this.

还是我的css:

nav > ul > li > a
{
    padding: 0.2em 2em 0.2em 2em;
    background-color: #FAFAFA;
}
nav > ul > li > a:hover
{
    background-color: #AFAFAF;
}

似乎没有达到我的html:

doesn't seem to reach my html:

<!DOCTYPE html>
...
<body>
<header>
    <nav>
        <a class="inblock valignC logo" href="/"><img src="static/img/logo.gif" /></a>
        <!--Menu nav : LOGO | Agence | Portfolio | Equipe | Clients | Contact-->
        <ul class="inblock valignC">
            <li class="inline"><a class="ie" href="/agence/">Agence</a></li>
        ...
        </ul>
...

,我必须使用专用的.ie类

in IE8, I have to use the dedicated .ie class I added on targetted <a>s.

任何解释?

推荐答案

您需要使用 HTML5 Shiv for IE 9下的版本:

You need to use the HTML5 Shiv for IE versions under 9:

<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->

这篇关于css child(&gt;)选择器不工作在IE8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆