-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The element matched by :only-of-type do not need a parent element. #30138
Comments
Hey! Thank you for bringing this up :) To be honest, I can’t even find this limitation mentioned in the Level 3 spec. But even if it’s there, this is not relevant anymore, and this note is rather confusing: it looks like it’s trying to say something important but ends it with “nah, never mind”. Feel free to send a PR removing this note, there’s no need for it anymore. |
The note talks about specs but have all the browsers implemented the Level 4 spec? |
If there is no such restriction, you need to delete the note. If there is, there is no need to delete it. |
html:only-of-type {
background-color: tomato;
} This snippet makes |
The only place I could find that mentioned parent for
All later versions of the spec don’t mention this limitation. It should be safe to remove, considering everything. |
We need to update https://developer.mozilla.org/en-US/docs/Web/CSS/:only-child as well. |
MDN URL
https://developer.mozilla.org/en-US/docs/Web/CSS/:only-of-type
What specific section or headline is this issue about?
The selected element does not have to have a parent element
What information was incorrect, unhelpful, or incomplete?
Note: As originally defined, the selected element had to have a parent. Beginning with Selectors Level 4, this is no longer required.
What did you expect to see?
remove this note.
Do you have any supporting links, references, or citations?
https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-of-type
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/css/_colon_only-of-type
The text was updated successfully, but these errors were encountered: