A non-negative number indicating the height of the image resource in CSS pixels.
Examples<picture id="img">
<source
srcset="landscape.png"
media="(width >= 1000px)"
width="1000"
height="400" />
<source
srcset="square.png"
media="(width >= 800px)"
width="800"
height="800" />
<source
srcset="portrait.png"
media="(width >= 600px)"
width="600"
height="800" />
<img
src="fallback.png"
alt="Image used when the browser does not support the sources"
width="500"
height="400" />
</picture>
const img = document.getElementById("img");
const sources = img.querySelectorAll("source");
console.log(Array.from(sources).map((el) => el.height)); // Output: [400, 800, 800]
Specifications Browser compatibility
Loadingâ¦
See alsoHTMLCanvasElement.height
HTMLEmbedElement.height
HTMLIFrameElement.height
HTMLImageElement.height
HTMLObjectElement.height
HTMLVideoElement.height
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4