Book Image

Responsive Web Design with HTML5 and CSS3, Second Edition

By : Ben Frain
5 (1)
Book Image

Responsive Web Design with HTML5 and CSS3, Second Edition

5 (1)
By: Ben Frain

Overview of this book

Table of Contents (17 chapters)
Responsive Web Design with HTML5 and CSS3 Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using SVGs as filters


In Chapter 6, Stunning Aesthetics with CSS3, we looked at the CSS filter effects. However, they are not currently supported in Internet Explorer 10 or 11. That can be frustrating if you want to enjoy filter effects in 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 straight forward as you might imagine. For example, in example_07-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:

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">
     <defs>
          <filter id="myfilter" x="0" y="0">  
                <feColorMatrix in="SourceGraphic" type="hueRotate" values="90" result="A"/>
                &lt...