Apply Class to Image not Image Span

I’m looking for a way to apply a class directly to an image, rather than the span the image is in. I would like to disable some lazy loading for specific images and need to apply the class directly to the image.

Hi Jeff,

Unfortunately, that is not possible. But you can use that same class as a parent class to access the image tag. Just like the following example CSS code.

span.testimg img
{
    //CSS code
}

Hope it helps.
Thanks

Thanks for the reply.
I decided a fix instead would be to use a raw content element.
<img src="{{dc:post:featured_image}}" class="skip-lazy">
I was having some issue with the slider carousel not loading the last image (that shows up to the left of the first one) due to the lazy load I had implemented. This might help others with the same issue.

Hi Jeff,

Glad that you are able to find a solution to this and shared it with others.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.