Using SVGs as filters
In Chapter 7, Stunning Aesthetics with CSS3, we looked at the CSS filter effects. CSS filters aren't supported in older browsers like Internet Explorer 10 or 11. That can be frustrating if you have a project that requires filters and you want/need to support those browsers.
Luckily, with help from SVG, we can create filters that work in Internet Explorer 10 and 11 too, but as ever, it's perhaps not as straightforward as you might imagine. For example, in example_08-05
, we have a page with the following markup inside the body:
<img class="HRH" src="[email protected]" />
It's an image of the Queen of England. Ordinarily, it looks like this:
Figure 8.11: An image with no SVG filter applied
Now, also in that example folder, is an SVG with a filter defined in the defs
elements. The SVG markup looks like this:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"...