From the course: Creating Web Icons with SVG
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add backwards compatibility with SVGeezy
From the course: Creating Web Icons with SVG
Add backwards compatibility with SVGeezy
- [Voiceover] Treating SVGs like regular images by placing them inside an image element is by far the easiest method for displaying SVGs on the web. However, like I mentioned in the previous movie, this method has a problem when I comes to older browsers that do not support SVGs. In those older browsers, in place of an SVG, you'll just see a little red X indicating there's an image here that is not being displayed. So, to support these older browsers, we need to figure out a way of swapping out this SVG for some other supported image format, like a PNG, in those older browsers. The simplest solution to this problem is a JavaScript plug-in called SVGeezy that you can download directly from GitHub. All you need here is this one file, SVGeezy.min.js, and you initialize it, and pass a couple of instructions on how you want it to use. Here you can either use a specific class to tell SVGeezy to ignore certain images. In this example that cause no check, or you can simply set that property…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Overview of the methods1m
-
(Locked)
Add SVG as a regular image4m 9s
-
(Locked)
Add backwards compatibility with SVGeezy4m 8s
-
(Locked)
Add SVG as an inline element4m 12s
-
(Locked)
Add backwards compatibility and more with SVGInjector6m
-
(Locked)
Add SVG as a background image2m 23s
-
(Locked)
Make SVG background images backward compatible1m 50s
-
(Locked)
A word on SVG accessibility4m 25s
-
(Locked)
-
-
-
-