-3

I think we can all agree that this selector would be very helpful, as indicated by many questions asked here on SO, which would be easily resolved by using it (see for example Can I combine :nth-child() or :nth-of-type() with an arbitrary selector? and linked questions). Usually we have to end up changing structure, adding classes or messing around with jQuery.

Why is this selector not in the standard? Why do we have :nth-of-type, but not :nth-of-class? Is there some reasoning behind it or is it just missing for no particular reason?

Community
  • 1
  • 1
JoannaFalkowska
  • 2,771
  • 20
  • 37
  • Anyone care to explain why is this question downvoted? I can not find any reason why would it be considered off-topic, duplicate or low quality. – JoannaFalkowska Jun 22 '16 at 13:24
  • This has been asked before http://stackoverflow.com/questions/5545649/can-i-combine-nth-child-or-nth-of-type-with-an-arbitrary-selector – Joey M-H Jun 22 '16 at 13:29
  • Well... this question actually has completely different scope but indeed it seems an answer can be found there. Still those are not the same questions. – JoannaFalkowska Jun 22 '16 at 13:33
  • 2
    It's just not the type of question that should really be asked here. From the stackoverflow guidelines: (1) "If your motivation for asking the question is “I would like to participate in a discussion about ______”, then you should not be asking here." (2) "avoid asking subjective questions where … there is no actual problem to be solved: “I’m curious if other people feel like I do.” (3) "you are asking an open-ended, hypothetical question: “What if ______ happened?” – Joey M-H Jun 22 '16 at 13:37
  • 1
    Okay, thank you. Honestly I just expected a yes/no answer with possible elaboration as to why. I don't feel like I am qualified to understand the decisions that W3C makes and asked out of curiosity to maybe better understand how is the standard constructed. I still am not sure if this question is really so bad. Similar question for Java in 2012 somehow got 250 upvotes for example: http://stackoverflow.com/questions/8725387/why-is-there-no-sortedlist-in-java – JoannaFalkowska Jun 22 '16 at 13:41

1 Answers1

0

It seems it is a feature planned for CSS4: https://drafts.csswg.org/selectors-4/#the-nth-child-pseudo

I guess this could let us deduce it was omitted in CSS3 for no specific reason.

This answer doesn't satisfy me though. Parent selector :has is also in this draft, and there are plenty of very good reasons why was it not there before.

JoannaFalkowska
  • 2,771
  • 20
  • 37