Advertisement
Home Open Editor ❯

HTML <source> height Attribute

Example

<picture>
  <source media="(min-width:900px)" srcset="computer.png" width="900" height="400">
  <source media="(min-width:600px)" srcset="clock.png" width="600" height="800">
  <source media="(min-width:300px)" srcset="desk.jpg" width="300" height="800">
  <img src="mobile.png" alt="mobile" style="width:auto;">
</picture>

Try this code ❯

Meaning

The height attribute allowed if the source element's parent is a <picture> element, but not allowed if the source element's parent is an <audio> or <video> element.


Standard Syntax

<source height="pixel">


Advertisement

Attribute Values

Value Description
pixel The intrinsic height of the image, in pixels. Must be an integer without a unit.
Home Open Editor ❯
Advertisement