-1

I have a construct of html like this:

<article>
  <div class="no-feature-image">
   <another divs>...
  </div>
</article>

And now I want to add display:none to whole tag witch has div with "no-feature-image". I tryed to do like this but it doesn't work:

article[no-feature-image] {
display:none
}

Ho can I make to not display every with some specific class? Here I want to remove all articles without images :(

Temani Afif
  • 245,468
  • 26
  • 309
  • 415
wenus
  • 1,345
  • 6
  • 24
  • 51

1 Answers1

0

Try this one:

article:has(> .no-feature-image) {
  display:none
}
Hai Pham
  • 2,188
  • 11
  • 20