2

Is there a way to select the inner child (deepest) using css selectors. Se example below:

<div class='d1 view'>
    <div class='d2 view'>
        <div class='d3 view'></div>
    </div>
    <div class='d4 view'>
        <div class='d5 view'>
            <div class='d6 view'></div>
        </div>
    </div>
</div>

The d1-d6 classes is just for simplifying my question.

I now want to select d3 and d6.
Note the list of children can be infinite. So is there a way to select - using css selectors - the deepest child?

I made a JSFiddle using jQuery

Andreas Louv
  • 46,145
  • 13
  • 104
  • 123

1 Answers1

3

Currently with CSS there is no way to select the deepest child of a parent element. You'll have to resort to jQuery to solve this.

There are a couple of questions that cover this already.

Community
  • 1
  • 1
Kyle
  • 65,599
  • 28
  • 144
  • 152