Re: [selectors] Need to clearly define matching for :first-child, :nth-*, etc

On 15/07/2015 20:47, Tab Atkins Jr. wrote:

> (But seriously, what are people misinterpreting this as? Do they think
> :first-child shouldn't match an element without a parent? Switching
> away from the "parent/child" language was *explicitly* meant to avoid
> that sort of misinterpretation!)

Have you tried the following:

  <html>
    <head>
    <style>
      html { color: red }
      html:first-child{ color:green }
    </style>
    </head>
    <body>
      <p>foo</p>
    </body>
  </html>

The paragraph is red in Firefox and Chrome. :first-child does NOT match
the root element because it has no parent...

</Daniel>

Received on Wednesday, 15 July 2015 19:02:10 UTC