I wonder if I can use tag <img>
like <video>
. When I want to add a video to my website I use:
<video>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
</video>
The result is that browser loads only first file, which are supported. It's possible to do the same with <img>
? I want to add icons in svg and png/jpg format, so browser will loads the one, which support. Or maybe is better to do it with some Javascript to detect user-agent
and then replace graphics in other format?