mozilla
Your Search Results

    Element.clientHeight

    The Element.clientHeight read-only property returns the inner height of an element in pixels, including padding but not the horizontal scrollbar height, border, or margin.

    clientHeight can be calculated as CSS height + CSS padding - height of horizontal scrollbar (if present).

    Note: This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect().

    Syntax

    var h = element.clientHeight;

    h is an integer representing height of the element in pixels.

    Example

    padding-top

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    padding-bottom

    Left Top Right Bottom margin-top margin-bottom border-top border-bottom

    Specification

    Specification Status Comment
    CSS Object Model (CSSOM) View Module
    The definition of 'clientheight' in that specification.
    Working Draft  

    Notes

    clientHeight is a property introduced in the Internet Explorer object model.

    See Also

    Hide Sidebar