Skip to content

Instantly share code, notes, and snippets.

@johnsardine
Last active August 29, 2015 14:07
Show Gist options
  • Save johnsardine/c319d612ea7a0365a744 to your computer and use it in GitHub Desktop.
Save johnsardine/c319d612ea7a0365a744 to your computer and use it in GitHub Desktop.
SVG on Websites

What have I learned so far?

(The android situations were experienced using 4.1.1)

The general support is good, as a background and with an svg file being used as src in an <img> tag.

However there are some issues still.

In android, SVG files used with <img> tags may appear stragely, or dont appear at all.

To fix this, the svg file must be used inline.

In android, if an image is used in CSS as a background and it has a background size set in pixels, it may not work. But if 100% is used, it will appear. My recomendation is to use pseudo elements, set the background as 100% and give it a width and height. This may not suit all needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment