We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How can I target a deeply nested element in CSS without specifying all parent divs?

How can I target a deeply nested element in CSS without specifying all parent divs?

grafficNZ
Shopify Partner
13 0 1

Hi all,

I'm trying to target the class 'allStates' on a certain page on my Shopify site (screenshot of HTML below).

Is there quick way to target it in CSS without including every parent div before .allStates?

My CSS (which doesn't work):

#1907-sparkling-water-350ml-11-8fl-oz-24-pack .allStates {

display:none;

}

Screen-Shot-2021-10-20-at-11.18.38-AM.png

 

Thanks

Replies 0 (0)