-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
  • 180,975
  • 14
  • 166
  • 216
wenus
  • 1,041
  • 6
  • 18
  • 32

1 Answers1

0

Try this one:

article:has(> .no-feature-image) {
  display:none
}
Hai Pham
  • 1,941
  • 7
  • 20