A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

I propose to create previous selector in next level

son
2014-09-01

I propose to create previous selector in next level

like this: <div id=“div1”></div> <div id=“div2”></div>

style “#div2” element, apply “#div1” element.

tabatkins
2014-09-01

I can’t tell what you’re actually trying to suggest here.

rvinay88
2014-09-01

I agree I don’t understand what he is trying to imply. But a syntax for parent selector would be immensely useful. For example, something like the following div < .tab-content would result in selecting the parent div of the given selector.

Chris Coyier wrote an article about this http://css-tricks.com/parent-selectors-in-css/

p4bl1t0
2014-09-01

maybe !#div1 + #div2 on css selector level 4?

tabatkins
2014-09-02

We dropped that particular syntax. :slight_smile: We replaced it with jQuery’s :has() syntax, which is equivalent in power. (Always look at the Editor’s Draft rather than the TR version.)

So @rvinay88’s example would be div:has(> .tab-content), and if @p4bl1t0 is right about what the OP was intending, it would be written #div1:has(+ #div2).