CSS no sibling selector

There is no sibling selector to match elements (or not) by class.

The closest selector I can think of is

.iwant:only-child

But this selector means that there cannot be any other elements besides that div class="iwant" as children of the parent div, regardless of type or class. This may fulfill your need depending on the structure of your HTML though, so it’s worth a try. If class names are a problem for you, though, then there probably isn’t much of a solution, because there isn’t an :only-of-class pseudo-class in CSS which filters by class and ignores the rest.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)