• Resolved gswartz

    (@gswartz)


    We’re trying to center an image and are using the standard wordpress aligncenter class on the image tag. When I view the source code it’s there. But in the browser developer tools it’s missing. If I disable the wp accessibility plugin the class does show up. So, it appears that the plugin is running some javascript to remove it from the image. I don’t see a way in the settings to disable this. Is this possible? If not, why is it removing the class?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Joe Dolson

    (@joedolson)

    WP Accessibility doesn’t have any code that is intended to remove any classes from an image; but that doesn’t mean that something weird couldn’t be happening.

    Can you share a link to a page where this problem is occurring?

    Thread Starter gswartz

    (@gswartz)

    The page is here – https://www.lowpricemedicaresupplement.com/medicare-101/medicare-part-a-hospital-insurance/

    The image in question is the one that says “How much does medicare part A cost”. If you view source and look at the image code it has class=”wp-image-7779 size-full aligncenter” but when you inspect element, all the classes are removed. The only plugin I disabled was the WP Accessibility plugin and when I did so, the classes were preserved.

    Thanks!

    Plugin Author Joe Dolson

    (@joedolson)

    OK – this is because you’re using the long description overlay. When a longdesc overlay is applied, the classes for the image are moved to the div element wrapping the image.

    I think the easiest solution for you is to go to Appearance > Customize > Additional CSS and add this:

    div.aligncenter { width: fit-content; }

    Thread Starter gswartz

    (@gswartz)

    Thanks. I’ll check that out.

    Thread Starter gswartz

    (@gswartz)

    Unfortunately that doesn’t work. Firefox reports that as an invalid property value. What is the long description overlay? I want to see if I can turn that off.

    Thread Starter gswartz

    (@gswartz)

    Nevermind, I found the setting for that in the plugin settings section. Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘class getting removed from image’ is closed to new replies.