3

I am creating a print stylesheet and would like to hide all figure tags only if that tag contains an iframe, which happen to be embedded YouTube videos. If the figure tag contains anything else (i.e. an img), I want the tag and its contents to still be shown on the printed page.

I know that I could simply apply a class of "video", for example, to my figure tag where appropriate, but I want to see if there is a way to accomplish this via CSS without resorting to adding classes throughout my site. Also, even though I know they exist, I am not looking for a jQuery solution.

Thank you!

BoltClock
  • 630,065
  • 150
  • 1,295
  • 1,284
CanuckInSC
  • 39
  • 2

1 Answers1

0

You are looking for a parent selector

CSS3 has none, but CSS4 has one that is like selecting using $.

Here are some similar questions with similar results:

Community
  • 1
  • 1
Praveen Kumar Purushothaman
  • 154,660
  • 22
  • 177
  • 226