W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2019

Re: [csswg-drafts] [selectors-4] need "first-matching-sibling" combinator (#3813)

From: v-python via GitHub <sysbot+gh@w3.org>
Date: Mon, 08 Apr 2019 11:21:18 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-480791220-1554722477-sysbot+gh@w3.org>
<div><p id=p1><p id=p2><p id=p3><p id=p4></div>

.p2 ~2 p   would choose .p4
.p2 ~ p:nth-of-type(2)  would not choose anything, because the 2nd child of the parent is .p2, which is not its own sibling.

~N chooses the Nth matching sibling, not the sibling that happens to be Nth child of its parent, if that Nth child happens to also be a sibling of the left element.

GitHub Notification of comment by v-python
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3813#issuecomment-480791220 using your GitHub account
Received on Monday, 8 April 2019 11:21:20 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:46 UTC