Example below. How would I change the display of the p in the SR element? #one ?SHADOW-ROOT-QUERY-SELECTOR? p { display: none};
<div>
<p>My Website</p>
<div id="one">
<!--#shadow-root (open)-->
<div id="two">
<div id="three">
<p>Text</p>
</div>
</div>
</div>
</div>
2
Answers
You can use the child selector (
#three p
) or the immediate child selector (#three > p
). Like this for the immediate child selector:Here’s more on CSS selectors
Or:
Or CascadiaJS’s answer.