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

Discover More
HTML - Picture element

The picture element is a container that is used to group different source versions of the same image. The browser can then choose the right image depending on : its capability ( may not yet support...
HTML - Sizing (Width and Height attribute)

Not all HTML tag supports the Width and Height attributes. If you want to size a div, you need for instance to use the CSS sizing feature that supports the width property The width and height HTML...
The height attribute in HTML

What is the height attribute and where can you apply it ?

Share this page:
Follow us:
Task Runner