Element.clientHeight

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

La propiedad de sólo lectura Element.clientHeight devuelve la altura de un elemento en píxeles, incluyendo el padding pero no las barras horizontales, el borde o el margen.

clientHeight puede ser calculado como CSS height + CSS padding - alto de la barra horizontal (si existe).

Nota: Esta propiedad redondeará el valor a un entero. Si necesitas un valor fraccional usa element.getBoundingClientRect().

Sintaxis

js
var h = element.clientHeight;

h es un entero que representa el alto de element en píxeles.

Ejemplo

Image:Dimensions-client.png

Especificaciones

Specification
CSSOM View Module
# dom-element-clientheight

Compatibilidad con navegadores

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
clientHeight

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Véase también