Andrew's Digital Garden

:has(:not()) vs :not(:has())

.card:has(:not(img)) means "select a card that has any element that is not an image"

.card:not(:has(img)) means “select a card that doesn't have an image”.

https://www.matuzo.at/blog/2022/100daysof-day50

[[20211115082404-css-not-selector]] [[20210816101731-css-has]]

[[css]]

:has(:not()) vs :not(:has())