Monday 25 December 2017

css3 - CSS: selecting an element only if it contains a specific element

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!

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...