SVG images can be used as an image format in a number of contexts. Many browsers support SVG images in:
Additionally, Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) introduced support for using SVG in these contexts:
For security purposes, Gecko places some restrictions on SVG content when it's being used as an image:
- External resources (e.g. images, stylesheets) cannot be loaded, though they can be used if inlined through BlobBuilder object URLs or data: URIs.
:visited-link styles aren't rendered.
- Platform-native widget styling (based on OS theme) is disabled.
Note that the above restrictions are specific to image contexts; they don't apply when SVG content is viewed directly, or when it's embedded as a document via the
|Feature||Chrome||Firefox (Gecko)||Internet Explorer||Opera||Safari|
|in CSS background||4||Unknown (4)||9||9.5||5|
|in other contexts||?||Unknown (4)||?||?||?|
|Feature||Android||Firefox Mobile (Gecko)||IE Mobile||Opera Mobile||Safari Mobile|
|in CSS background||3.0||4.0 (4)||?||10.0||3.2 (Partially supported)|
|in other contexts||?||4.0 (4)||?||?||?|
Compatibility data from caniuse.com
- HTML 5, Section 4.7.1: The img element
- CSS Backgrounds and Borders Module Level 3, Section 3.3: The 'background-image' property
- Inline SVG in HTML and XHTML