How can I style or add class to a css element depending on content type. My example: I wish to add class or style a p element when it contain an iframe like this.
<p><iframe frameborder="0" height="400" marginheight="0" marginwidth="0" scrolling="no" src="https://www.hashdoc.com/documents/185392/embed" style="border:1px solid #EAE9EA; border-width:1px; margin-bottom:5px; max-width: 100%;" title="Les résultats aux examens" width="550"></iframe></p>
So it could be something like that:
if p contain iframe add class 'myclass' to p
Can I do that with sass or do I need js?
EDIT: my final jquery code
$(".page-lycee p:has(iframe)").addClass('external-content');
p > iframe { your css }and if you want to apply every iframe in p tag then directly usep iframe { css }