main:has(h3) {}
Parent selector. Any <main> that has h3 inside of it then style <main>
example: see style sheet
ul li:has(+ li) {}
- Hello -1
- Hello -2
- Hello -3
- Hello -4
Every li has border-bottom without last li
p:not(:has(span)) {}
That Means Every Paragraph does not have a <span> inside of it those are styled
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eius ullam soluta asperiores dolore iusto iure?
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eius ullam soluta asperiores dolore iusto iure?
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eius ullam soluta asperiores dolore iusto iure?
nav:has(a:hover) a:not(:hover) { opacity: 0.3}
when hover nav item, other items will be dim
Example:div:has(p:empty) {}
If div has empty paragraph then style the div
- Item-1
- Item-2
- Item-3
- Item-4