Skip to content

Incorrect statement about pseudo-elements needing to come last in a selector #32971

Open
@m-akinc

Description

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements

What specific section or headline is this issue about?

Syntax

What information was incorrect, unhelpful, or incomplete?

The pseudo-element must appear after all the other components in the complex or compound selector in which it appears. For example, you can select a paragraph's first line using p::first-line but not the first-line's children or a hovered first line. So both p::first-line > * and p::first-line:hover are invalid.

This is not true for all pseudo-elements. ::part() supports appending pseudo-classes like :hover. This is even shown in the ::part documentation examples. I'm not sure if there are other pseudo-elements besides ::part() that support this.

What did you expect to see?

At least call out any exceptions (like ::part():hover).

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Assignees

No one assigned

    Labels

    Content:CSSCascading Style Sheets docsgoal: accuracy(Experimental label) Issues about inaccurate/incorrect content.help wantedIf you know something about this topic, we would love your help!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions