0

I want to add Viewbox value for dynamically control Google Geochart svg. This svg was not fit to the container in IE Browser

Not by using viewbox attribute is there any way to control svg to be fit to the div container

  • possible duplicate of [SVG in img element proportions not respected in ie9](http://stackoverflow.com/questions/9777143/svg-in-img-element-proportions-not-respected-in-ie9) – davidcondrey Aug 01 '14 at 08:33

1 Answers1

0

Post your code to clarify but potential issues.

It won't scale properly in internet explorer if you have a width and/or height attribute on the svg. Remove the width and height but keep the viewbox defined and it will work better.

You can also target IE specifically with your CSS if you need to:

img[src*=".svg"] { width: 100%\9; }

@media screen and (min-width:0\0) {
    img[src*=".svg"] { width: 100%; }
}
davidcondrey
  • 34,416
  • 17
  • 114
  • 136