Saturday, February 10, 2018

css3 - Is there a CSS "haschildren" selector?










Is there a css selector I can use only if a child element exists?




Consider:






I would like to apply display:none to div only if it doesn't have at least one child

  • element.



    Any selector I can use do this?


  • Answer



    Nope, unfortunately that's not possible with CSS selectors.



    No comments:

    Post a Comment

    plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

    In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...