has() CSS logical pseudo-class (how to style a parent element)

Опубликовано: 05 Ноябрь 2024
на канале: daily tutorials
26
3

The functional :has() CSS pseudo-class represents an element if any of the relative selectors that are passed as an argument match at least one element when anchored against this element.
This pseudo-class presents a way of selecting a parent element or a previous sibling element with respect to a reference element by taking a relative selector list as an argument.
The :has() pseudo-class takes on the specificity of the most specific selector in its arguments the same way as :is() and :not() do.