- From: Amelia Bellamy-Royds <amelia.bellamy.royds@gmail.com>
- Date: Thu, 16 Apr 2015 21:44:23 -0600
- To: Brian Birtles <bbirtles@mozilla.com>, www-svg <www-svg@w3.org>
Received on Friday, 17 April 2015 03:44:54 UTC
Elaboration: http://codepen.io/AmeliaBR/details/wBZrog The basic structure is, within inline SVG, create an `<image>` element that has a `src` attribute pointing to your fallback content, but an invalid `xlink:href` attribute. Old browsers see a non-standard HTML `<img>`, modern browsers see an empty SVG `<image>`, everyone is happy. It's probably not quite as common a fallback technique as using JS (either directly or by using Modernizr to set CSS classes), but it is more robust. And it is used. It might be used even more frequently soon: the above demo was created for a blog post on SVG Fallbacks, which will be published in the near future on CSS-Tricks. If suddenly `src` gained meaning in SVG, and especially if it took precedence over `xlink:href`, these SVGs would be downloading fallback images and painting them overtop of the SVG content. On 16 April 2015 at 20:27, Brian Birtles <bbirtles@mozilla.com> wrote: > > Amelia brought up concerns about people using 'src' on an SVG image to > provide some fallback to an HTML image. I don't know the particular pattern > so perhaps she can elaborate. > >
Received on Friday, 17 April 2015 03:44:54 UTC