Title: Get elements by wrapping class
Last modified: February 8, 2018

---

# Get elements by wrapping class

 *  Resolved [Zoker](https://wordpress.org/support/users/zoker/)
 * (@zoker)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-elements-by-wrapping-class/)
 * Hi there,
 * I’m using visual composer and I would like to use this plugin, too.
    I know that
   I need to add the class to the img element itself, but why is it not possible
   to add the class to a higher element?
 * Like a wrapping element and then catch it via `.style-svg img` ?
 * Or is that technically impossible?
 * Thank you!

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

 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-elements-by-wrapping-class/#post-9957222)
 * Hello,
 * Unfortunately that’s not possible at the moment. But you can use it with visual
   composer still though.
 *  Thread Starter [Zoker](https://wordpress.org/support/users/zoker/)
 * (@zoker)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-elements-by-wrapping-class/#post-9957469)
 * For people who need the same:
 * And just add `.style-svg-container` to the image element class field
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-elements-by-wrapping-class/#post-9957579)
 * Does that work swapping the IMG tag with inline SVG code?
 * The only reason you need to use the class at all is if you want to render your
   SVG code inline… It’s not needed at all if you just want to use your SVG files
   like any other image.
 * I’d be interested to hear if that actually works to swap out the IMG tag.
 *  Thread Starter [Zoker](https://wordpress.org/support/users/zoker/)
 * (@zoker)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-elements-by-wrapping-class/#post-9959520)
 * Yes it works. I just adjust the jquery selector to also look for `img` inside
   a `style-svg-container` element.
 * And since I want the inline svg replacement to style the svg element, that works
   fine for me 🙂

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

The topic ‘Get elements by wrapping class’ is closed to new replies.

 * ![](https://ps.w.org/svg-support/assets/icon.svg?rev=3554681)
 * [SVG Support](https://wordpress.org/plugins/svg-support/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/svg-support/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/svg-support/)
 * [Active Topics](https://wordpress.org/support/plugin/svg-support/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/svg-support/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/svg-support/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Zoker](https://wordpress.org/support/users/zoker/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/get-elements-by-wrapping-class/#post-9959520)
 * Status: resolved