elementor icon indicating copy to clipboard operation
elementor copied to clipboard

Image Widget with Link and SVG size override

Open thezenmonkey opened this issue 5 years ago β€’ 43 comments

Prerequisites

  • [ x] I have searched for similar features requests in both open and closed tickets and cannot find a duplicate.
  • [x ] The feature is still missing in the latest stable version of Elementor ( Elementor Pro. )

What problem is your feature request going to solve? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] When uploading SVG to and image widget and adding a link the width is set to 48px in CSS. It ignores size specifications from the widget. See frontend.min.css .elementor-widget-image .elementor-image > a img[src$=".svg"], .elementor-widget-image .elementor-image figure > a img[src$=".svg"] {width: 48px;}

Describe the solution you'd like A clear and concise description of what you want to happen. Allow overriding the 48px width of svgs in image widget

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Currently I write I add an width declaration via custom css

Additional context Add any other context or screenshots about the feature request here.

thezenmonkey avatar Apr 01 '20 15:04 thezenmonkey

+1 long time and incomprehensible bug/feature, which was claimed to be solved but it isn’t.

black-eye avatar Apr 01 '20 18:04 black-eye

+1. Just ran across this and issues with it on Facebook group go back quite some time. The 48px width overrides everything else and the only way to adjust it is custom css defining pixels. This is a problem since most of us use percentages for images. Screen Shot 2020-04-15 at 3 29 36 PM

twerkema avatar Apr 15 '20 20:04 twerkema

+1 Same here

MarieComet avatar Apr 23 '20 07:04 MarieComet

+1 Fix this overly aggressive CSS.

datajunkee avatar Jun 11 '20 13:06 datajunkee

Still an issue in 3.0.11

JosiahCarberry avatar Oct 01 '20 17:10 JosiahCarberry

So the problem here is that SVG's won't display with width: 100% and need a defined set of pixels? Why not do a default of 100vw instead, which seems to work, and do a fallback to 48px for older browsers?

CodeBradley avatar Oct 25 '20 03:10 CodeBradley

I just ran into this in 3.0.10 Pro. This makes SVGs fairly useless; I don't want to have to train my customers to add some custom CSS class for each SVG image. Here's a screencast illustrating the issue: https://www.loom.com/share/bb92894a370c410a8111800298080cea .

caspervoogt avatar Feb 08 '21 16:02 caspervoogt

+1 Same issue here. Please fix!

renemorozowich avatar Feb 17 '21 16:02 renemorozowich

+1 That's a serious issue, please fix it asap. Thanks!

immdraselkhan avatar Aug 23 '21 16:08 immdraselkhan

Seriously elementor? This is not an April joke from thezenmonkey, it is real and still here!

JCwebTECH avatar Sep 14 '21 21:09 JCwebTECH

+1 // I just lost time on this issue as well. πŸ‘ŽπŸ»

aryon avatar Sep 24 '21 16:09 aryon

+1 πŸ˜’

7diac avatar Nov 02 '21 14:11 7diac

Hello, I have this problem πŸ˜’

How to fix it vΓ­a CSS agressive? please share a solution, i not like to use PNG images please! only SVG

Thanks!

jhosmanlizarazo avatar Nov 06 '21 15:11 jhosmanlizarazo

In fact the CSS selector .elementor-widget-image a img[src$=".svg"] should be removed from Elementor core. Otherwise the image width needs to be defined manually, which makes no sense.

mbaierl avatar Jan 28 '22 12:01 mbaierl

+1

I wrote one line of css for quick solution. Add this as Custom CSS to fix this issue

/* elementor bug */ .elementor-widget-image a img[src$=".svg"] { width: auto !important; }

ali-han avatar Feb 02 '22 15:02 ali-han

Please Elementor do something about this small issue.

thiname avatar Feb 21 '22 13:02 thiname

This issue seems to still occur on Elementor Pro 3.7.1.

MeliMarie avatar May 30 '22 09:05 MeliMarie

Yes please thanks for information.and keep it ups good plugins.

On Mon, May 30, 2022, 2:57 PM MeliMarie @.***> wrote:

This issue seems to still occur on Elementor Pro 3.7.1.

β€” Reply to this email directly, view it on GitHub https://github.com/elementor/elementor/issues/11031#issuecomment-1140952441, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZKMDOYKCZYSNBJRY6DODH3VMSGHLANCNFSM4LZCF3WA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

BINPAKISTAN avatar May 30 '22 11:05 BINPAKISTAN

It's 2022 and this is still an issue...

besweeet avatar Jun 11 '22 15:06 besweeet

+5 Insert this as Custom CSS /* elementor bug */ .elementor-widget-image a img[src$=".svg"] { width: auto !important; }

Does not work. For me, it hides the SVG completely...

besweeet avatar Aug 27 '22 18:08 besweeet

Same here, the custom CSS hides the SVG, works when I insert a fix width and height, but that is not the solution we need.

smoseraumayer avatar Sep 07 '22 09:09 smoseraumayer

This issue still occurs on Elementor Pro 3.7.5

smoseraumayer avatar Sep 07 '22 09:09 smoseraumayer

Can confirm issue still exists with the latest Elementor Pro. It occurs when linking the logo. This override does work for me.

/* elementor bug */ .elementor-widget-image a img[src$=".svg"] { width: auto !important; }

NeseemGit avatar Sep 07 '22 23:09 NeseemGit

I am surprised this is STILL an issue. This is overly opinionated CSS and I see no reason for it. SVGs can be used at all kinds of sizes, not just icons. Bad bad bad.

caspervoogt avatar Oct 25 '22 15:10 caspervoogt

Chiming in here. It's still an issue.

ziich avatar Nov 28 '22 22:11 ziich

Can confirm issue still exists with the latest Elementor Pro. It occurs when linking the logo. This override does work for me.

/* elementor bug */ .elementor-widget-image a img[src$=".svg"] { width: auto !important; }

It does work for me! Cheers

uxwisetech avatar Jan 04 '23 11:01 uxwisetech

This shrinking svg issue seems to still persist.

When the image in an image widget is an svg, adding links to the image widget will erroneously cause the image to shrink dramatically, breaking user's justified expectations.

β€’ Elementor, would you please fix this issue?

Matherone avatar Jan 13 '23 13:01 Matherone

Can confirm issue still exists with the latest Elementor Pro. It occurs when linking the logo. This override does work for me.

/* elementor bug */ .elementor-widget-image a img[src$=".svg"] { width: auto !important; }

auto didn't work, but 100% did and you don't even need an !important tag. Below is the code i used:

/* elementor bug */ .elementor-widget-image a img[src$=".svg"] { width: 100%; }

Correction: Both Auto and 100% cause issues on Mozilla so I can't recommend using either of these fixes. The only thing that works is removing the width:48px CSS which Elementor must do...

image

acgorecki avatar Feb 02 '23 23:02 acgorecki

I cant imagine why anyone would write css that sets the width across all svg images. What bad coding practice.

JonathanCrossland avatar Feb 23 '23 12:02 JonathanCrossland

I cant imagine why anyone would write css that sets the width across all svg images. What bad coding practice.

It's a workaround that seems to function correctly. Beats how Elementor hard-coded linked SVG dimensions...

besweeet avatar Feb 23 '23 13:02 besweeet