I was wondering why, when I add a custom class (say on an image), it adds the class to the parent DIV and not the IMG tag itself. This is a little frustrating having to write complex CSS just to select this image. Am I doing something wrong?
Hey Michael. Thanks for reaching out with your question!
The reason we put the CSS class on the parent div is so you can easily target any of the child elements. The photo module isn’t the best example of this since, generally, one would only want to target the actual image. But if you were using a content slider or an accordion (these have many HTML elements that make up the module), putting the CSS class on the parent div gives a bit more flexibility.
If you need some assistance targeting the image tag itself in CSS, I’d be happy to walk you through that. Just let me know!