paint-brush
Using the CSS Parent Selectors, :has()by@smpnjn
1,372 reads
1,372 reads

Using the CSS Parent Selectors, :has()

by Johnny Simpson3mJuly 9th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

CSS Selectors 4 introduces a new selector called ':has()', which finally lets us select parents. This is already supported in **Safari**, and is also in Chrome 105. In this article, I will focus on how CSS parent selection works, and how you can do it today where support is available. In the meantime, if you require full support in all browsers, you can also [implement] a polyfill until support is fully implemented. Combining parent selection with other selectors, we can combine this for specific circumstances.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Using the CSS Parent Selectors, :has()
Johnny Simpson HackerNoon profile picture
Johnny Simpson

Johnny Simpson

@smpnjn

Product, Engineering, Web

About @smpnjn
LEARN MORE ABOUT @SMPNJN'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Johnny Simpson HackerNoon profile picture
Johnny Simpson@smpnjn
Product, Engineering, Web

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Freshnews
Platypush
Coffee-web