That’s an elegant solution. I would add that an entry can link to two stylesheets, in which case the last one (included in the optional MDD) takes precedence. So, it can override the basic, no-MDD stylesheet without having to use !important
, which generally should be avoided. Or you can you can write the selector in the second stylesheet with higher specificity. Anyway, it’s a great idea worth trying.
There are JS solutions, but not all methods work in dictionary software. But I remember this works in MDict PC (Internet Explorer):
if (!(document.querySelector("SomeImage").height>0)) {document.querySelector("SomeElement").style.display="none"};
Basically, if the image height is not greater than 0, then hide certain elements. IIRC, IE treats the height differently from the width when the image is absent. I don’t know how other dictionary software behave.