• Resolved mpmchugh

    (@mpmchugh)


    It seems that SVG images used in Divi Image Modules do not render in Chrome and Firefox, as their width and height end up being 0.

    I had to add css to the Image Module Advanced settings to set the width and height to auto (the margins are set to center, as I’m not using 100% width).

    https://www.evernote.com/l/AAL7ll26HhZKgZecYQd8CR_MBvDPoKX7MIc

    Is this the best way?

    I tried adding the “style-svg” class to the module, but that didn’t do anything.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Hi there,

    Thanks for using my plugin!

    I use it with Divi a lot and have never had to do this. The image usually fills the width of the column it is in…
    Maybe there is something else conflicting, or are you using a child theme that plays with image styles at all?
    Either way, if you have to set a width for whatever reason, the way you e done it is fine.

    Another way is to set all your image modules to have the same styles in your child theme stylesheet or the Divi custom CSS, avoiding having to put code in every image module.

    Adding the style-svg class will only allow my plugin to target the img tag and swap it with inline SVG code which isn’t necessary unless you need to inline that code… that’s not standard practice, it’s just to animate/style elements within the SVG itself.

    I hope this helps.

    Thread Starter mpmchugh

    (@mpmchugh)

    Nope. I’m just using the barest of child themes for Divi. It’s just odd. Perhaps something else is conflicting.

    Thread Starter mpmchugh

    (@mpmchugh)

    Interestingly, just saw this posted to a Divi Facebook Group I follow — perhaps this is related to the issues I’ve been seeing. The author notes he’s shared it with you, but just in case…:

    “I’ve been playing around with using inline svg’s and used SVG Support by Benbodhi. Sadly the plugin wasn’t affecting svg images added in most of Divi’s modules.
    I ended up tinkering with the plugin to find a workaround and added the additional functionality that could prove handy for others. If anyone is interested the modified version is available on GitHub. (I have also shared this info with the original author and hopefully)”

    https://github.com/ipokkel/svg-support

    Plugin Author Benbodhi

    (@benbodhi)

    Hi,

    I think your issue is slightly different as it isn’t to do with using the class to inline the SVG.
    But I have indeed been contacted about this and will be looking at the code and considering implementing it or similar when I get a chance.

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

The topic ‘Using SVG in Divi Image Modules’ is closed to new replies.