%% generate tags start %%
#software-engineering
%% generate tags end %%
#software-engineering/css
> [!info] See also
> [:has() - CSS: カスケーディングスタイルシート | MDN (mozilla.org)](https://developer.mozilla.org/ja/docs/Web/CSS/:has)
The functional **`:has()`** CSS [pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes) represents an element if any of the [relative selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors/Selector_structure#relative_selector) 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](https://developer.mozilla.org/en-US/docs/Web/CSS/Selector_list#relative_selector_list) as an argument.
```css
/* Selects an h1 heading with a
paragraph element that immediately follows
the h1 and applies the style to h1 */
h1:has(+ p) {
margin-bottom: 0;
}
```