IE8在内容不显示之前

时间:2012-10-09 14:34:44

标签: javascript css internet-explorer-8 pseudo-element

以下是违规页面的链接:http://www.wrightspecialty.com/brokers-agents-questionnaire.html?view=foxcontact

我正在使用的表单构建器存在限制。无法插入文本,除非它是文本框,输入等的标签.IE9,Firefox,Safari和Chrome都能正确显示。 IE7没有支持,IE8也有限制。

所以我试图使用:before伪选择器插入副本。对于IE8及以下,我使用谷歌的JavaScript。这适用于IE7而不是IE8

    <!--[if lt IE 9]>
        <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script> 
    <![endif]-->

我正在瞄准css中的每个元素:

    .foxcontainer_brokers div:nth-child(11):before, .foxcontainer_brokers div:nth-child(14):before, .foxcontainer_brokers div:nth-child(17):before, .foxcontainer_brokers div:nth-child(20):before, .foxcontainer_brokers div:nth-child(23):before, .foxcontainer_brokers div:nth-child(23):before, .foxcontainer_brokers div:nth-child(26):before, .foxcontainer_brokers div:nth-child(29):before {
        float: left;
        margin-left: 0;
        margin-bottom: 15px;
        padding-left: 3px;
        width: 100%;
        font-weight: bold;
        clear: both;
        font-size: 12px;
    }

    .foxcontainer_brokers div:nth-child(11):before {
        content: "Schools 8211 - Elementary and Secondary Schools";
    }

    etc...

有人有什么想法吗?提前谢谢。

2 个答案:

答案 0 :(得分:3)

问题不在于你的:before伪元素,IE8确实支持。这是你的:nth-child()伪类...和你的::before双冒号伪元素,IE8都不支持。

如果IE9脚本由于某种原因不起作用,也许你应该尝试像Selectivizr +你选择的选择器库(例如jQuery)。如果你试图支持IE8,你也应该避免伪冒号的双冒号,因为它不理解这种语法。

答案 1 :(得分:1)

IE8不支持css3选择器(nth-child)