Unspoiled9710
Unspoiled9710

Reputation: 102

Exclude all child elements inside of a specified parent element

I want to set some attributes on all text excluded text in <nav>...</nav>.

I know it can be done using :not() but it only applies on parent element, not on children within that parent.

Is it possible, to apply :not() on all children within parent?

Upvotes: 0

Views: 1535

Answers (1)

sbrand5020
sbrand5020

Reputation: 76

This could help:

nav *:not(....)

The * is a wildcard selector.

Maybe this is interesting for you too: Can I write a CSS selector selecting elements NOT having a certain class or attribute?

Upvotes: 1

Related Questions