The <source>
tag is used to specify
the available file sources, it is used in
<picture>
, <audio>
and <video>
tags as well.
Let's look at an example:
New image formats like avif
and
webp
are not supported by old
browsers. Here
the browser renders the first
supported image file format it
encounters. Thus, having multiple source
files also ensures the older browsers
are also supported.