SVG rendering issue in Android Browser

Simon Jentsch

In the default Android Browser for older Android versions (4.1, maybe 4.2/4.3 [It is on the Android device of a customer, i'm not exactly sure which version he uses]) SVG sprites are not rendered correctly. Instead of showing the correct clipping with the correct size, the browser shows a smaller version of the image, showing the whole sprite, like in the screenshot below (Android Browser 4.1):

Android screenshot (false rendering)enter image description here

it should look like this:

Android screenshot (correct rendering) enter image description here

Here's the CSS for the sprites:

.sprite {
  display: inline-block;
  background-image: url('img/sprite.svg');
  background-repeat: no-repeat;
  background-size: 1000px 1000px;
  overflow: hidden;
  color: transparent !important;
}

.sprite.logo {
  width: 270px;
  height: 55px;
  background-position: 0 0;
  display: block;
}

[...]

Every other Browser (including Android Browser 4.4) shows everything correctly.

Tigran Petrossian

This issue exists on Android 4.3- and IE9. To solve this, simply specify width and height attributes for svg tag in you file.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SVG Rendering Issue iOS

From Dev

SVG Rendering Issue iOS

From Dev

Rendering Issue in Android Studio

From Dev

SVG WPF C# Rendering Issue

From Dev

Meteor mongo issue in multiple svg rendering

From Dev

Android xml rendering issue in eclipse?

From Dev

WebView Rendering Issue in Android KitKat

From Dev

Rendering issue for Android with Intellij 13.1.3

From Dev

Android back button rendering issue

From Dev

links issue on stock android browser

From Dev

Android browser rendering half width of html text

From Dev

HTML5 - SVG issue with rendering an image in IE 11

From Dev

express svg image element rendering issue in safari/firefox

From Dev

Rendering issue using Android Studio 0.4.0

From Dev

Urdu font rendering issue in android 4.1

From Dev

rendering issue after going to Android Studio 2.1

From Dev

Layout Rendering issue android studio 0.8.0

From Dev

Android Drawable (Progress Bar, Switch) rendering issue

From Dev

Urdu font rendering issue in android 4.1

From Dev

rendering issue after going to Android Studio 2.1

From Dev

SVG text element not showing in android browser

From Dev

android browser scrolling issue in phonegp application

From Dev

Cross browser d3.js SVG line rendering date sorting

From Dev

Cross browser d3.js SVG line rendering date sorting

From Dev

android / chrome web font rendering issue - vertical/width cropping

From Dev

Browser Incompability - wrong rendering

From Dev

Browser white space rendering

From Dev

Browser Incompability - wrong rendering

From Dev

htmlspecialchars not rendering correctly in browser