代码之家  ›  专栏  ›  技术社区  ›  DisgruntledGoat

firefox的css3“nth child”支持?

  •  0
  • DisgruntledGoat  · 技术社区  · 16 年前

    根据CSS3.信息 selector test ,firefox 3.0支持第n个子选择器的一些排列。但是,显示的代码 here (30)不适合我。

    它应该选择空段落,所以我将代码编辑为以下内容,但它不会显示在Firefox中(它在Opera中工作)。

    <style type="text/css">
    div :nth-child(even) {
        background-color: yellow;
        height: 30px;
    }
    </style>
    
    <div>
        <div>Does this element match?</div>
        <div></div>
        <div>Does this element match?</div>
        <div></div>
    </div>
    

    这是测试中的错误,还是我在某个地方出错了?

    3 回复  |  直到 15 年前
        1
  •  3
  •   DisgruntledGoat    15 年前

    隐马尔可夫模型。。。根据 this page 火狐3.0不支持 :nth-child .

        2
  •  1
  •   Hannoun Yassir    16 年前

    如果使用jquery this 可能对您有帮助(jquery不关心您的用户使用的浏览器:)

        3
  •  1
  •   Allen Pike    15 年前

    在firefox 3.5中,您的测试用例现在按预期工作。