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
var h = element.clientHeight;
h
es un entero que representa el alto de element en píxeles.
Ejemplo
Especificaciones
Specification |
---|
CSSOM View Module # dom-element-clientheight |
Compatibilidad con navegadores
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
clientHeight |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support