I propose to create previous selector in next level


#1

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.


#2

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


#3

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/


#4

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


#5

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).