Saturday, 10 February 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

    casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

    In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...