Curiosity_is_Learning Curiosity_is_Learning - 3 years ago 126
HTML Question

Fallback to png using the "use" tag

there are some issues displaying SVGs for older IE versions. My question is then: is there a way to fallback to a png while using the "use" tag?

I am using Angular 2, so if could be solved using this framework, that would also be OK. Doing it in the HTML is preferred.

Below is the code for displaying the SVG.

<svg class="logo" viewBox="0 0 70 70" preserveAspectRatio="xMinYMid">
<use [attr.xlink:href]="logoPath" (error)="useDefaultImage()"></use>

Answer Source

Did not use the tag at all. Replaced it with inline SVG.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download