Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg distorting when using .img-responsive in IE 10 #10073

Closed
wroughtec opened this issue Aug 23, 2013 · 10 comments
Closed

svg distorting when using .img-responsive in IE 10 #10073

wroughtec opened this issue Aug 23, 2013 · 10 comments
Labels
Milestone

Comments

@wroughtec
Copy link

I have a svg logo that with .image-responsive class that looks fine in chrome, firefox etc ie it fills the width area and keeps its proportions however in IE 10 it becomes elongated ie the width is correct but is trying to stay the same height as the origional source.

I fixed by adding height:100% \9; to the class so it is ignored by firefox and chrome (as height 100% displays weird in Chrome)

Not sure if the is a problem for all image types in IE10 or just svg just thought I would add this quick fix here encase anyone else has the same issue.

@zlatanvasovic
Copy link

.image-responsive isn't a Bootstrap class. .img-responsive is. Also, it's just for <img>, not for <svg> or <canvas>.

@wroughtec
Copy link
Author

Yep corrected the class typo whoops
An svg can be in a img tag
img src="someimage.svg" class="img-responsive"

@mdo
Copy link
Member

mdo commented Dec 1, 2013

Can you put together a jsbin or jsfiddle demonstrating this?

@mdo
Copy link
Member

mdo commented Dec 2, 2013

I see no issues with http://jsbin.com/ezEYuvU/1/. Aspect ratio looks good in IE10. Could be you have fixed dimensions elsewhere? Can't be sure without more info though, but until then, closing out since I didn't see any problems.

@mdo mdo closed this as completed Dec 2, 2013
@wroughtec
Copy link
Author

Hi Sorry for not getting back sooner I have managed to replicate:

http://jsbin.com/IKOfOsi/1/

Seems to happen when it is put into a col-* as was fine when not. Could not reproduce with the google logo one you used however that had a an svg.png extension so something else may be occuring there. Hope this helps

Have included a few examples

@wroughtec
Copy link
Author

Sorry does also appear to happen without a col-* image the first svg i tried was less than 300px.

Also appears to be an issue on Safari on the Mac (is fine on Windows)

@bjarneheden
Copy link

I´m also having the same issue as above with distorted svg images on IE11.
wroughtec already has a code example (above).

Not sure how to work around this when you load the svg dynamically. (for our own images we could probably add preserveAspectRatio attribute to the svg itself. But that does not help when loading svgs not created manually etc.

@cvrebert
Copy link
Collaborator

cvrebert commented Jun 3, 2014

Updated the JS Bin to use BootstrapCDN: http://jsbin.com/IKOfOsi/6/

@cvrebert
Copy link
Collaborator

cvrebert commented Jun 3, 2014

Confirmed.

@cvrebert cvrebert reopened this Jun 3, 2014
@cvrebert cvrebert added this to the v3.2.1 milestone Jun 3, 2014
@cvrebert
Copy link
Collaborator

cvrebert commented Jun 3, 2014

@mdo mdo modified the milestones: v3.2.1, v3.2.0 Jun 19, 2014
@mdo mdo mentioned this issue Jun 19, 2014
@mdo mdo closed this as completed in 46e8a58 Jun 19, 2014
stempler pushed a commit to stempler/bootstrap that referenced this issue Nov 4, 2014
TT-- added a commit to TT--/TT--.github.io that referenced this issue Apr 23, 2017
(svg distorting when using .img-responsive in IE 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants