HTML - Source


source is an element that specifies the characteristic of an instance:

Example image

With width and height

  <source media="(max-width: 799px)" srcset="480w.jpg" width="600" height="279">
  <source media="(min-width: 800px)" srcset="800w.jpg" width="1500" height="300">
  <img src="800w.jpg" alt="Default if the media condition are not met" width="1500" height="300">

An img element with a src attribute should always be specified as fallback

Documentation / Reference

Powered by ComboStrap