I'm having problems with SVG Scaling on Android phones.
Several parts of my site are based on the fact that both the width and the height are used for the SVG placed in the <img> tag. All browsers except Android 4.1.2 Native Browser (NOT CHROME) scale SVG. Right and perfect without distorting the aspect ratio.
Here's a screenshot of how it displays in Firefox (and all browsers) 
Here is a screenshot of how it is displayed in Android 4.1.2 Native Browser. 
Testing URL http://prashantsani.com/demos/svgIssue/
I tried all of the solutions below, but none of them worked.
Adjusting the width, height and viewing area does not work. In addition, preserveAspectRatio does not work either. <svg width="443.5" height="100" viewBox="0 0 443.5 100" preserveAspectRatio="xMidYMid meet">
Finishing inside another SVG didn't do the trick (Also, I don't want to center the image, rather, I need to scale the image). Software Centering Path svg
I tried this: SVG Resize image from aspect ratio , but it doesn't work either. Width and height are already given by integers, not% or px.
Please read the following answers before answering:
- Since in some places the layout requires both width and height, I have to keep both in some places.
- This problem ONLY occurs in the NATIVE BROWSER APP application on Android 4.1.2 {Browser application}. It works brilliantly, as expected in Chrome and all other browsers on Android 4.1.2.
- A violin or code will be useful if you find a solution.
- Do not plan to use any image format other than SVG.
- Width and height are both indicated in% through css .... and SVG should scale accordingly.
Thanks.
android html responsive-design svg
Prashant
source share