CSS selector to get deepest element of specific class in the HTML tree

前端 未结 8 2338
温柔的废话
温柔的废话 2020-11-28 14:49

I\'ve got a a bunch of DIV elements in my HTML, several of which have their class attribute set to \"rowsLayout\". Some of these rowsLayout DIVs can be nested inside one an

8条回答
  •  忘掉有多难
    2020-11-28 15:51

    Why not use :empty?

    JQuery Empty

    EDIT: It also works as a CSS Selector:

    :empty { background-color: black; }
    

    MORE EDITS:

    :last-of-type almost works, but it gets 'a' for some reason. See my fiddle.

    http://jsfiddle.net/DUdVR/3/

提交回复
热议问题